我们很抱歉,但是出现了一些问题。 - 使用Rails,Apache,Passenger

时间:2021-01-04 18:10:07

I have Rails 3.2.3 with Apache and Passenger.

我有Apache和Passenger的Rails 3.2.3。

I have a project working in development mode. When I switch the project to production mode (Passenger standard) it gives me an HTTP Error 500:

我有一个项目在开发模式下工作。当我将项目切换到生产模式(乘客标准)时,它给我一个HTTP错误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

3 个解决方案

#1


28  

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.log in your current production app.

确保你已经跑了$:。 bundle install如果不成功,请转到生产环境并使用ssh和$:连接到服务器。在当前的生产应用程序中使用tail -f log / production.log。

this will generate an output wich might show an error.

这将生成可能显示错误的输出。

if this doesn't show an error in the log/ directory do $:. ls -la if there are any passenger.error files open the latest and check for errors there.

如果这没有在log /目录中显示错误,请执行$:。 ls -la如果有任何passenger.error文件打开最新文件并检查那里的错误。

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.log or /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。而是在那里写了一些错误。有关详细信息,请参阅“乘客手册”的“故障排除”部分:

#2


18  

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.consider_all_requests_local更改为true,我可以在生产中显示错误消息并查看实际问题是什么。显然,一旦你解决了问题就改回来了。

#3


1  

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)。

#1


28  

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.log in your current production app.

确保你已经跑了$:。 bundle install如果不成功,请转到生产环境并使用ssh和$:连接到服务器。在当前的生产应用程序中使用tail -f log / production.log。

this will generate an output wich might show an error.

这将生成可能显示错误的输出。

if this doesn't show an error in the log/ directory do $:. ls -la if there are any passenger.error files open the latest and check for errors there.

如果这没有在log /目录中显示错误,请执行$:。 ls -la如果有任何passenger.error文件打开最新文件并检查那里的错误。

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.log or /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。而是在那里写了一些错误。有关详细信息,请参阅“乘客手册”的“故障排除”部分:

#2


18  

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.consider_all_requests_local更改为true,我可以在生产中显示错误消息并查看实际问题是什么。显然,一旦你解决了问题就改回来了。

#3


1  

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)。