3
这可能很简单,但我不明白为什么我没有得到错误页面。导轨404 422 500完全空白
首先,我使用Heroku进行托管,所以它绝对处于生产模式。
如果我将行“config.action_controller.consider_all_requests_local”设置为true,我会得到一个详细的错误消息,否则,我会得到一个完全100%的空白屏幕。如果我查看来源,也是空白。
我所有的404,422,500.html文件都是公开的,我没有触及它们。
他们似乎在我的本地机器上工作,如果我在那里开始生产模式。所以它必须与Heroku有关?有任何想法吗?
日志告诉我什么都没有用。
下面是production.rb文件
config.cache_classes = true
#ActionMailer::Base.delivery_method = :sendmail
Paperclip.options[:command_path] = "/usr/bin/"
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
# set delivery method to :smtp, :sendmail or :test
config.action_mailer.delivery_method = :smtp
# Full error reports are disabled and caching is turned on
config.action_controller.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.action_view.cache_template_loading = true
你可能是对的。我添加了一个rescue_action_in_public方法,它似乎能够完成这项工作,但我仍然想知道是否有更好的方法可以让我自己发明轮子? – holden 2010-03-02 19:29:59