0

我正在尝试将我的 rails 应用程序部署到生产环境中,但是遇到了一些问题。我正在使用 Nginx 和 Unicorn,该应用程序已经在生产环境中运行了一段时间,但是今天早些时候我的托管服务提供商的硬件错误导致该站点关闭,并且在尝试恢复它时,独角兽错误日志中出现了以下错误:

E, [2012-11-23T21:30:03.291386 #4370] ERROR -- : reaped #<Process::Status: pid 7795 exit 1> worker=0
I, [2012-11-23T21:30:03.291819 #4370]  INFO -- : worker=0 spawning...
I, [2012-11-23T21:30:03.310884 #7801]  INFO -- : worker=0 spawned pid=7801
I, [2012-11-23T21:30:03.311488 #7801]  INFO -- : Refreshing Gem list
/home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/faraday-0.7.6/lib/faraday/connection.rb:1:in `require': no such file to load -- addressable/uri (LoadError)
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/faraday-0.7.6/lib/faraday/connection.rb:1:in `<top (required)>'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/faraday-0.7.6/lib/faraday.rb:68:in `require'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/faraday-0.7.6/lib/faraday.rb:68:in `<top (required)>'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/oauth2-0.5.2/lib/oauth2/client.rb:1:in `require'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/oauth2-0.5.2/lib/oauth2/client.rb:1:in `<top (required)>'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/oauth2-0.5.2/lib/oauth2.rb:2:in `require'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/oauth2-0.5.2/lib/oauth2.rb:2:in `<top (required)>'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/bitly-0.7.0/lib/bitly/v3.rb:5:in `require'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/bitly-0.7.0/lib/bitly/v3.rb:5:in `<top (required)>'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/bitly-0.7.0/lib/bitly.rb:9:in `require'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/bitly-0.7.0/lib/bitly.rb:9:in `<top (required)>'
from /home/deployer/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in `require'
from /home/deployer/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /home/deployer/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in `each'
from /home/deployer/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in `block in require'
from /home/deployer/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in `each'
from /home/deployer/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in `require'
from /home/deployer/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler.rb:119:in `require'
from /home/deployer/apps/stealthygecko/releases/20121123212740/config/application.rb:7:in `<top (required)>'
from /home/deployer/apps/stealthygecko/releases/20121123212740/config/environment.rb:2:in `require'
from /home/deployer/apps/stealthygecko/releases/20121123212740/config/environment.rb:2:in `<top (required)>'
from config.ru:4:in `require'
from config.ru:4:in `block in <main>'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
from config.ru:1:in `new'
from config.ru:1:in `<main>'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/unicorn-4.2.1/lib/unicorn.rb:44:in `eval'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/unicorn-4.2.1/lib/unicorn.rb:44:in `block in builder'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/unicorn-4.2.1/lib/unicorn/http_server.rb:694:in `call'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/unicorn-4.2.1/lib/unicorn/http_server.rb:694:in `build_app!'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/unicorn-4.2.1/lib/unicorn/http_server.rb:567:in `init_worker_process'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/unicorn-4.2.1/lib/unicorn/http_server.rb:587:in `worker_loop'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/unicorn-4.2.1/lib/unicorn/http_server.rb:487:in `spawn_missing_workers'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/unicorn-4.2.1/lib/unicorn/http_server.rb:498:in `maintain_worker_count'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/unicorn-4.2.1/lib/unicorn/http_server.rb:272:in `join'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/gems/unicorn-4.2.1/bin/unicorn:121:in `<top (required)>'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/bin/unicorn:23:in `load'
from /home/deployer/apps/stealthygecko/shared/bundle/ruby/1.9.1/bin/unicorn:23:in `<main>'

这是我的 Gemfile:

gem 'rake'                                                                                                                                                                                                  
gem 'rails', '3.2.6'                                                                                                                                                                                        
gem 'mysql2'                                                                                                                                                                                                
gem 'bcrypt-ruby', '~> 3.0.0'                                                                                                                                                                               
gem 'gravtastic'                                                                                                                                                                                            
gem "friendly_id"                                                                                                                                                                                           
gem "videawesome"                                                                                                                                                                                           
gem "will_paginate", "~>3.0.3"                                                                                                                                                                              
gem "bitly"                                                                                                                                                                                                 
gem "sanitize"                                                                                                                                                                                              
gem "newrelic_rpm"                                                                                                                                                                                          
gem 'capistrano'                                                                                                                                                                                            
gem 'rvm-capistrano'                                                                                                                                                                                        
gem "unicorn", "~> 4.2.1"                                                                                                                                                                                   
gem "wysihtml5-rails", "~> 0.0.2"                                                                                                                                                                           
gem 'airbrake'                                                                                                                                                                                              

group :assets do                                                                                                                                                                                            
  gem 'less-rails'                                                                                                                                                                                          
  gem 'jquery-rails'                                                                                                                                                                                        
  gem 'therubyracer'                                                                                                                                                                                        
  gem 'uglifier'                                                                                                                                                                                            
  gem 'twitter-bootstrap-rails'                                                                                                                                                                             
end 

据我所知,它是需要 oauth 的 Bitly gem,这就是问题所在,但我不知道如何解决这个问题。如果有人可以提供帮助,我将不胜感激。

提前致谢。

4

2 回答 2

1

看起来faradaygem 正在尝试要求addressable/uri,但这不在您的 Gemfile 中。

于 2012-11-23T21:58:23.207 回答
1

经过几个小时或部署并据称无处可去,事实证明,我所要做的就是完全停止 Unicorn 并重新启动它,而不是重新启动它。它现在找到了所有必要的依赖项。

在这一切中让我感到困惑的是,我读到 Faradays 对 Addressable 的依赖已在 8 月被删除,所以我很自然地不知道为什么它仍然被引用。

感谢您的帮助 Ipwnstuff 非常感谢。

于 2012-11-24T03:10:43.567 回答