Ruby-on-rails 我们很抱歉,但有些不对劲。- 使用 Rails、Apache、Passenger
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10513450/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
We're sorry, but something went wrong. - with Rails, Apache, Passenger
提问by Michael Stark
I have Rails3.2.3 with Apacheand Passenger.
我有Rails3.2.3Apache和Passenger。
I have a project working in development mode.
When I switch the project to production mode (Passengerstandard)
it gives me an HTTP Error 500:
我有一个在开发模式下工作的项目。当我将项目切换到生产模式(Passenger标准)时,它给了我HTTP Error 500:
We're sorry, but something went wrong.
我们很抱歉,但有些不对劲。
This happens even with WEBrick.
Can somebody help me?
即使使用WEBrick. 有人可以帮助我吗?
Edit:
编辑:
My production environment file: http://pastebin.com/ZAudSzkc
我的生产环境文件:http: //pastebin.com/ZAudSzkc
回答by dennis
Make sure you have ran $ bundle install. If this doesn't succeed, go to your production environment and connect to your server using ssh and $ tail -f log/production.login your current production app.
确保你已经跑了$ bundle install。如果这不成功,请转到您的生产环境并使用 ssh 和$ tail -f log/production.log您当前的生产应用程序连接到您的服务器。
This will generate an output which might show an error.
这将生成一个可能显示错误的输出。
If this doesn't show an error in the log/ directory do $ ls -laif there are any passenger.error files open the latest and check for errors there.
如果这在 log/ 目录中没有显示错误,请$ ls -la在有任何乘客.错误文件时打开最新文件并检查那里的错误。
Hope this helped you out!
希望这对你有帮助!
In addition to log/production.log, you should also look at the web server error log, typically /var/log/apache2/error.logor /var/log/nginx/error.log. Some errors are written there instead. More information can be found in the Troubleshooting section of the Passenger manual:
除了 log/production.log,您还应该查看 Web 服务器错误日志,通常是/var/log/apache2/error.log或/var/log/nginx/error.log。一些错误被写在那里。更多信息可以在乘客手册的故障排除部分找到:
回答by Chrissy H
I was struggling with a similar type of problem and found that by changing config.consider_all_requests_local to true in config/environments/production.rb, I could get the error message to display in production and see what the actual problem was. Obviously, change it back once you've fixed the problem.
我正在努力解决类似类型的问题,发现通过在 config/environments/production.rb 中将 config.think_all_requests_local 更改为 true,我可以在生产中显示错误消息并查看实际问题。显然,一旦你解决了问题,就把它改回来。
回答by BastianByte
We faced the same problem, same message, 500 error code, but it was in development mode and nothing useful was logged. And it only happened at one of my colleges setup.
我们遇到了同样的问题,同样的消息,500 错误代码,但它处于开发模式,没有记录任何有用的信息。它只发生在我的一所大学设置中。
The problem were non-ASCII chars (here: umlauts like ü, ? and so on) within strings. We now simply translate everything with I18n.t('text_to_translate')(find the corresponding yaml translation file in /config/locales/, for more info on I18N see http://guides.rubyonrails.org/i18n.html).
问题是字符串中的非 ASCII 字符(这里是 ü、? 等变音符号)。我们现在简单地翻译所有内容I18n.t('text_to_translate')(在 /config/locales/ 中找到相应的 yaml 翻译文件,有关 I18N 的更多信息,请参见http://guides.rubyonrails.org/i18n.html)。
回答by Gunnar Droege
I had a similar problem with django being installed in a passenger environment.
我在乘客环境中安装 django 时遇到了类似的问题。
The problem for me was that in the passenger_wsgi.pyfile the path to the custom virtualenv Python installation was wrong.
我的问题是在passenger_wsgi.py文件中自定义 virtualenv Python 安装的路径是错误的。

