gpt4 book ai didi

ruby-on-rails - 500 内部服务器错误与 Rails 生产

转载 作者:数据小太阳 更新时间:2023-10-29 08:04:37 35 4
gpt4 key购买 nike

我最近将一些新文件上传到我的生产服务器(并覆盖了旧文件),现在收到 500 Internal Server Error。服务器正在运行 phusion passenger(即使我不再收到该错误消息)并且在我的本地测试环境中一切似乎都运行良好。

这是网站: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 passenger install 但没有任何反应。

最近的事件:

  • 已安装 pg gem(但在决定暂时使用 sqlite3 后将其从 gem 文件中删除)yml 文件应该没问题...
  • 尝试在服务器和本地运行 bundle update,但它一直挂起
  • 更改了一些 javascript 和 css 文件...
  • 尝试使用 RAILS_ENV=production rake:db reset 重置服务器 - 没有变化!

编辑:运行 rails s production 时出现以下错误:

/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.

编辑 3:看起来它正在运行,仍然是内部服务器错误:

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$

最佳答案

做了以下事情:

  1. gem install passenger(没有 sudo 或任何东西)
  2. 找到root:passenger-config –root
  3. 将 chmod 提供给所有从根目录到用户名的文件夹:sudo chmod -R 777/home/username/.rvm/gems/ruby-1.9.3-p392/gems/passenger-4.0.14 到每个文件夹直到/home/用户名/
  4. passenger-install-apache2-module(没有任何东西)
  5. 将给定的代码粘贴到里面:/etc/apache2/httpd.conf
  6. sudo 服务 apache2 重启

关于ruby-on-rails - 500 内部服务器错误与 Rails 生产,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18561245/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com