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