我最近将一些新文件上传到我的生产服务器(并覆盖旧文件),现在收到 500 内部服务器错误。服务器正在运行 phusion 乘客(即使我不再收到该错误消息)并且在我的本地测试环境中一切似乎都工作正常。
这是网站: http: //www.pandonews.com/
当我查看我的 apache 日志时,我看到了这个错误:
[ pid=3106 thr=140057117177664 file=ext/apache2/Hooks.cpp:884 time=2013-09-01 17:37:24.84 ]: Unexpected error in mod_passenger: Cannot spawn application '/var/www/feedme': The spawn server died unexpectedly, and restarting it failed.
Backtrace:
in 'virtual Passenger::SessionPtr Passenger::ApplicationPool::Client::get(const Passenger::PoolOptions&)' (Client.h:742)
in 'Passenger::SessionPtr Hooks::getSession(const Passenger::PoolOptions&)' (Hooks.cpp:312)
in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:585)
我不知道问题是什么。到目前为止,它一直运行良好。我真的不知道从哪里开始来解决这个问题。我尝试再次运行 gem 乘客安装,但什么也没发生。
近期活动:
- 已安装 pg gem(但在决定暂时使用 sqlite3 后将其从 gem 文件中删除)yml 文件应该没问题...
- 尝试在服务器和本地运行捆绑更新,但它一直挂起
- 更改了一些 javascript 和 css 文件...
- 尝试使用 RAILS_ENV=production rake:db reset 重置服务器 - 没有变化!
编辑: 运行 rails 的生产时出现以下错误:
/home/otto/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- rack/handler/production (LoadError)
from /home/otto/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:251:in `block in require'
from /home/otto/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:236:in `load_dependency'
from /home/otto/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:251:in `require'
from /home/otto/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/handler.rb:63:in `try_require'
from /home/otto/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/handler.rb:16:in `get'
from /home/otto/.rvm/gems/ruby-1.9.3-p392/gems/rack-1.4.5/lib/rack/server.rb:272:in `server'
from /home/otto/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.7/lib/rails/commands/server.rb:59:in `start'
from /home/otto/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.7/lib/rails/commands.rb:55:in `block in <top (required)>'
from /home/otto/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.7/lib/rails/commands.rb:50:in `tap'
from /home/otto/.rvm/gems/ruby-1.9.3-p392/gems/railties-3.2.7/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
编辑2:
$ passenger-status
ERROR: Phusion Passenger doesn't seem to be running.
EDIT3: 似乎它正在运行,仍然是内部服务器错误:
passenger start -a 0.0.0.0 -p 3000 -d -e production
=============== Phusion Passenger Standalone web server started ===============
PID file: /var/www/feedme/tmp/pids/passenger.3000.pid
Log file: /var/www/feedme/log/passenger.3000.log
Environment: production
Accessible via: http://0.0.0.0:3000/
Serving in the background as a daemon.
===============================================================================
otto@scraper:/var/www/feedme$ passenger status
Phusion Passenger Standalone is running on PID 18788, according to PID file /var/www/feedme/tmp/pids/passenger.3000.pid
otto@scraper:/var/www/feedme$