2017-08-08 212 views
1

我有一個5.0.0.1項目出現問題部署它。我使用capistrano進行部署,它也爲我運行美洲獅。 puma得到運行並且「Somthing出錯了」錯誤顯示出來。
現在我在我的本地開發中運行項目出現問題,很奇怪!這個錯誤顯示:‍‍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)是的,我只能夠在本地運行項目bundle exec rails s
事情我嘗試:
1.清除Gemfile.lockbundle updatebundle install
2.卸載5.1.2,它抱怨,因爲我使用Git你不必5.1.2
3,我回到提交我確信它的工作。沒有!
4.嘗試將Activesupport 5.1.2 & 添加到gemfile。沒有
5.更改軌道版本更新的版本(其實不能去5.1因爲廢棄警告的)
6.檢查Gemfile.lock到處我看到Activesupport,其或類似>=4Rails 5生產錯誤有效支持


尋求生產錯誤:
1.編輯

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 
` 

回答

0

這是一個常見的錯誤。我固定它從Here
更改軌道版本從到5.0.1
不幸的是我還必須bundle exec rails s地方(我認爲它不會在生產工作,要麼,所以我之前忽略了它)。
但現在生產運行沒有任何錯誤。