Heroku上没有显示500错误页面 [英] 500 error page not showing on Heroku
问题描述
我试图在Heroku上显示自定义的500错误页面,运行rails 3.2.11 我已经按照以下步骤操作:
https://devcenter.heroku.com/articles/error-pages
该过程对维护页面正常工作,但似乎不适用于错误页面。我认为S3 URL在Heroku中是正确的,当我直接访问S3 URL时,我可以很好地查看错误页面(它已设置为public)。
config.consider_all_requests_local在production.rb中设置为false
关于Heroku为什么没有显示它的任何想法?我只是在各种浏览器中看到一个空白屏幕(Chrome表示这是一个500错误,但不会呈现页面)。 解决方案
当应用程序发生异常时,不会显示heroku的自定义错误页面。
您的应用程序负责显示此类页面。
请参阅在rails 3.2中使用exceptions_app 。
错误页面发生在与heroku发生错误时。
关于错误页面的devcenter页面说,关于测试错误页面:
要测试错误页面,您可以推送一个糟糕的部署,比如将一个语法错误放入一个关键的配置文件中,或者在您的应用程序中创建一个睡眠时间为35秒的路径(从而触发错误H12请求超时)。
I'm trying to get a custom 500 error page to show on Heroku, running rails 3.2.11
I've followed the steps at: https://devcenter.heroku.com/articles/error-pages
The process worked fine for the maintenance page, but doesn't seem to work for the error page. I'm positive the S3 URL is correct in Heroku, and when I visit the S3 URL directly I can view the error page just fine (it is set to public).
config.consider_all_requests_local is set to false in production.rb
Any ideas as to why Heroku is not showing it? I just get a blank screen in various browsers (Chrome says it's a 500 error but doesn't render a page).
解决方案The heroku's custom error page isn't displayed whenever an exception occurs in your application.
Your application is responsible for displaying this kind of pages.
See using exceptions_app with rails 3.2.The error page happens when an error occurs with heroku.
The devcenter page about error pages says, about testing your error page :
To test your error page, you can push a bad deploy such as putting a syntax error into a key configuration file, or by creating a path on your app that sleeps for 35 seconds (thereby triggering the error H12 Request Timeout.
这篇关于Heroku上没有显示500错误页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!