问题
i have a 5.0.0.1 project that got problem deploying it. i use capistrano to deploy and it runs puma for me too. puma gets run and "Somthing went wrong" error shows up.
And now i have problem running project in my local development, weird! this errors shows up: You have already activated activesupport 5.1.2, but your Gemfile requires activesupport 5.0.0.1. Prepending bundle exec to your command may solve this. (Gem::LoadError)
And yes im only able to run project locally with bundle exec rails s
.
Things i tried:
1. Clearing Gemfile.lock
and bundle update
and bundle install
2. Uninstalling 5.1.2
and it complaining you don't have 5.1.2
3. Because i'm using git, i went back to a commit that i was sure it worked. Nothing!
4. Try adding Activesupport 5.1.2
& 5.0.0.1
to gemfile. Nothing
5. Changing rails version to newer versions (Actually can't go to 5.1
because of deprecation warnings)
6. Checking Gemfile.lock
and everywhere i see Activesupport
, its 5.0.0.1
or something like >=4
Seeking production errors:
1. Edited
sudo tail production.log
F, [2017-08-09T00:32:34.086476 #14010] FATAL -- : rack (2.0.3) lib/rack/runtime.rb:22:in `call'
F, [2017-08-09T00:32:34.086508 #14010] FATAL -- : activesupport (5.0.0.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
F, [2017-08-09T00:32:34.086551 #14010] FATAL -- : actionpack (5.0.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
F, [2017-08-09T00:32:34.086586 #14010] FATAL -- : rack (2.0.3) lib/rack/sendfile.rb:111:in `call'
F, [2017-08-09T00:32:34.086619 #14010] FATAL -- : railties (5.0.0.1) lib/rails/engine.rb:522:in `call'
F, [2017-08-09T00:32:34.086651 #14010] FATAL -- : puma (3.4.0) lib/puma/configuration.rb:224:in `call'
F, [2017-08-09T00:32:34.086710 #14010] FATAL -- : puma (3.4.0) lib/puma/server.rb:569:in `handle_request'
F, [2017-08-09T00:32:34.086772 #14010] FATAL -- : puma (3.4.0) lib/puma/server.rb:406:in `process_client'
F, [2017-08-09T00:32:34.086808 #14010] FATAL -- : puma (3.4.0) lib/puma/server.rb:271:in `block in run'
F, [2017-08-09T00:32:34.086841 #14010] FATAL -- : puma (3.4.0) lib/puma/thread_pool.rb:114:in `block in spawn_thread'
I, [2017-08-09T00:33:50.110563 #14010] INFO -- : Started GET "/" for 2.177.64.100 at 2017-08-09 00:33:50 +0430
I, [2017-08-09T00:33:50.113789 #14010] INFO -- : Processing by StaticPagesController#home as HTML
I, [2017-08-09T00:33:50.115162 #14010] INFO -- : Rendering static_pages/home.html.erb within layouts/application
I, [2017-08-09T00:33:50.116416 #14010] INFO -- : Rendered static_pages/_non_logged_in_home.html.erb (0.9ms)
I, [2017-08-09T00:33:50.116508 #14010] INFO -- : Rendered static_pages/home.html.erb within layouts/application (1.3ms)
I, [2017-08-09T00:33:50.117616 #14010] INFO -- : Rendered layouts/_shim.html.erb (0.0ms)
I, [2017-08-09T00:33:50.118101 #14010] INFO -- : Rendered layouts/_header.html.erb (0.3ms)
I, [2017-08-09T00:33:50.118863 #14010] INFO -- : Rendered layouts/_footer.html.erb (0.6ms)
I, [2017-08-09T00:33:50.119039 #14010] INFO -- : Completed 200 OK in 5ms (Views: 4.3ms | ActiveRecord: 0.0ms)
F, [2017-08-09T00:33:50.120949 #14010] FATAL -- :
F, [2017-08-09T00:33:50.121013 #14010] FATAL -- : ArgumentError (key must be 32 bytes):
F, [2017-08-09T00:33:50.121047 #14010] FATAL -- :
F, [2017-08-09T00:33:50.121076 #14010] FATAL -- : activesupport (5.0.0.1) lib/active_support/message_encryptor.rb:72:in `key='
F, [2017-08-09T00:33:50.121112 #14010] FATAL -- : activesupport (5.0.0.1) lib/active_support/message_encryptor.rb:72:in `_encrypt'
F, [2017-08-09T00:33:50.121149 #14010] FATAL -- : activesupport (5.0.0.1) lib/active_support/message_encryptor.rb:58:in `encrypt_and_sign'
F, [2017-08-09T00:33:50.121177 #14010] FATAL -- : actionpack (5.0.0.1) lib/action_dispatch/middleware/cookies.rb:592:in `commit'
F, [2017-08-09T00:33:50.121203 #14010] FATAL -- : actionpack (5.0.0.1) lib/action_dispatch/middleware/cookies.rb:465:in `[]='
F, [2017-08-09T00:33:50.121229 #14010] FATAL -- : actionpack (5.0.0.1) lib/action_dispatch/middleware/session/cookie_store.rb:117:in `set_cookie'
F, [2017-08-09T00:33:50.121263 #14010] FATAL -- : rack (2.0.3) lib/rack/session/abstract/id.rb:363:in `commit_session'
F, [2017-08-09T00:33:50.121291 #14010] FATAL -- : rack (2.0.3) lib/rack/session/abstract/id.rb:234:in `context'
F, [2017-08-09T00:33:50.121316 #14010] FATAL -- : rack (2.0.3) lib/rack/session/abstract/id.rb:226:in `call'
F, [2017-08-09T00:33:50.121341 #14010] FATAL -- : actionpack (5.0.0.1) lib/action_dispatch/middleware/cookies.rb:613:in `call'
F, [2017-08-09T00:33:50.121381 #14010] FATAL -- : actionpack (5.0.0.1) lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
F, [2017-08-09T00:33:50.121424 #14010] FATAL -- : activesupport (5.0.0.1) lib/active_support/callbacks.rb:97:in `__run_callbacks__'
F, [2017-08-09T00:33:50.121453 #14010] FATAL -- : activesupport (5.0.0.1) lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
F, [2017-08-09T00:33:50.121479 #14010] FATAL -- : activesupport (5.0.0.1) lib/active_support/callbacks.rb:90:in `run_callbacks'
F, [2017-08-09T00:33:50.121505 #14010] FATAL -- : actionpack (5.0.0.1) lib/action_dispatch/middleware/callbacks.rb:36:in `call'
F, [2017-08-09T00:33:50.121544 #14010] FATAL -- : actionpack (5.0.0.1) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
F, [2017-08-09T00:33:50.121571 #14010] FATAL -- : actionpack (5.0.0.1) lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call'
F, [2017-08-09T00:33:50.121622 #14010] FATAL -- : actionpack (5.0.0.1) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
F, [2017-08-09T00:33:50.121650 #14010] FATAL -- : railties (5.0.0.1) lib/rails/rack/logger.rb:36:in `call_app'
F, [2017-08-09T00:33:50.121676 #14010] FATAL -- : railties (5.0.0.1) lib/rails/rack/logger.rb:24:in `block in call'
F, [2017-08-09T00:33:50.121709 #14010] FATAL -- : activesupport (5.0.0.1) lib/active_support/tagged_logging.rb:70:in `block in tagged'
F, [2017-08-09T00:33:50.121756 #14010] FATAL -- : activesupport (5.0.0.1) lib/active_support/tagged_logging.rb:26:in `tagged'
F, [2017-08-09T00:33:50.121791 #14010] FATAL -- : activesupport (5.0.0.1) lib/active_support/tagged_logging.rb:70:in `tagged'
F, [2017-08-09T00:33:50.121821 #14010] FATAL -- : railties (5.0.0.1) lib/rails/rack/logger.rb:24:in `call'
F, [2017-08-09T00:33:50.121847 #14010] FATAL -- : actionpack (5.0.0.1) lib/action_dispatch/middleware/request_id.rb:24:in `call'
F, [2017-08-09T00:33:50.121879 #14010] FATAL -- : rack (2.0.3) lib/rack/method_override.rb:22:in `call'
F, [2017-08-09T00:33:50.121908 #14010] FATAL -- : rack (2.0.3) lib/rack/runtime.rb:22:in `call'
F, [2017-08-09T00:33:50.121934 #14010] FATAL -- : activesupport (5.0.0.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
F, [2017-08-09T00:33:50.121959 #14010] FATAL -- : actionpack (5.0.0.1) lib/action_dispatch/middleware/executor.rb:12:in `call'
F, [2017-08-09T00:33:50.121993 #14010] FATAL -- : rack (2.0.3) lib/rack/sendfile.rb:111:in `call'
F, [2017-08-09T00:33:50.122020 #14010] FATAL -- : railties (5.0.0.1) lib/rails/engine.rb:522:in `call'
F, [2017-08-09T00:33:50.122046 #14010] FATAL -- : puma (3.4.0) lib/puma/configuration.rb:224:in `call'
F, [2017-08-09T00:33:50.122070 #14010] FATAL -- : puma (3.4.0) lib/puma/server.rb:569:in `handle_request'
F, [2017-08-09T00:33:50.122095 #14010] FATAL -- : puma (3.4.0) lib/puma/server.rb:406:in `process_client'
F, [2017-08-09T00:33:50.122126 #14010] FATAL -- : puma (3.4.0) lib/puma/server.rb:271:in `block in run'
F, [2017-08-09T00:33:50.122154 #14010] FATAL -- : puma (3.4.0) lib/puma/thread_pool.rb:114:in `block in spawn_thread'
2.
bundle exec puma -e production -w 1 -b unix:///tmp/m.sock
[22429] Puma starting in cluster mode...
[22429] * Version 3.4.0 (ruby 2.4.1-p111), codename: Owl Bowl Brawl
[22429] * Min threads: 5, max threads: 5
[22429] * Environment: production
[22429] * Process workers: 1
[22429] * Preloading application
/home/deploy/m/shared/bundle/ruby/2.4.0/gems/activesupport-5.0.0.1/lib/active_support/xml_mini.rb:51: warning: constant ::Fixnum is deprecated
/home/deploy/m/shared/bundle/ruby/2.4.0/gems/activesupport-5.0.0.1/lib/active_support/xml_mini.rb:52: warning: constant ::Bignum is deprecated
DEPRECATION WARNING:config.serve_static_filesis deprecated and will be removed in Rails 5.1.
Please useconfig.public_file_server.enabled = falseinstead.
(called from block in <top (required)> at /home/deploy/m/releases/20170807074848/config/environments/production.rb:25)
/home/deploy/m/shared/bundle/ruby/2.4.0/gems/activesupport-5.0.0.1/lib/active_support/core_ext/numeric/conversions.rb:138: warning: constant ::Fixnum is deprecated
[22429] * Listening on unix:///tmp/m.sock
[22429] Use Ctrl-C to stop
[22429] - Worker 0 (pid: 22458) booted, phase: 0
3.
sudo tail puma_error.log
puma (3.4.0) lib/puma/server.rb:569:inhandle_request'
puma (3.4.0) lib/puma/server.rb:406:in process_client'
puma (3.4.0) lib/puma/server.rb:271:inblock in run'
puma (3.4.0) lib/puma/thread_pool.rb:114:in block in spawn_thread'
[18099] Early termination of worker
[18102] ! Detected parent died, dying
=== puma startup: 2017-08-07 12:20:28 +0430 ===
[22077] - Worker 0 (pid: 22080) booted, phase: 0
[22077] Early termination of worker
[22080] ! Detected parent died, dying
Gemfile:
`source 'https://rubygems.org'
gem 'rails', '5.0.0.1'
gem 'bcrypt', '3.1.11'
gem 'faker', '1.6.6'
gem 'carrierwave', '0.11.2'
gem 'mini_magick', '4.5.1'
gem 'fog', '1.38.0'
gem 'will_paginate', '3.1.5'
gem 'bootstrap-will_paginate', '1.0.0'
gem 'bootstrap-sass', '3.3.6'
gem 'sass-rails', '5.0.6'
gem 'uglifier', '3.0.0'
gem 'coffee-rails', '4.2.1'
gem 'jquery-rails', '4.1.1'
gem 'turbolinks', '5.0.1'
gem 'jbuilder', '2.4.1'
gem 'sdoc', '0.4.0', group: :doc
group :development do
gem 'sqlite3', '1.3.12'
gem 'byebug', '9.0.0', platform: :mri
gem 'web-console', '>= 3.1.1'
gem 'capistrano', '~> 3.7', '>= 3.7.1'
gem 'capistrano-rails', '~> 1.2'
gem 'capistrano3-puma'
gem 'capistrano-rbenv', '~> 2.1'
gem 'capistrano-nginx'
gem 'capistrano-rails-db'
gem 'capistrano-rails-console'
gem 'capistrano-upload-config'
gem 'sshkit-sudo'
end
group :development, :test do
gem 'listen', '3.0.8'
gem 'spring', '1.7.2'
gem 'spring-watcher-listen', '2.0.0'
end
group :test do
gem 'rails-controller-testing', '0.1.1'
gem 'minitest-reporters', '1.1.9'
gem 'guard', '2.13.0'
gem 'guard-minitest', '2.4.4'
end
group :production do
gem 'pg', '0.18.4'
gem 'rails_12factor', '0.0.2'
gem 'puma', '3.4.0'
end
`
回答1:
That was an common bug. and i fixed it from Here
Changed rails version from 5.0.0.1
to 5.0.1
Unfortunately i still must bundle exec rails s
for local (And i thought it won't work in production either so i just ignored it before).
But now production runs up without any errors.
来源:https://stackoverflow.com/questions/45561273/rails-5-production-error-activesupport