Ale*_*dre 36 debugging ruby-on-rails
Rails 3.2.3
在生产模式中,我有一个错误,它显示标准的"我们很抱歉"页面.在开发模式中没有错误.
我需要获得有关错误的更多信息,因此我想关闭"我们很抱歉"页面并查看错误.我知道它必须被称为"rails s -e production",我在我的本地计算机上进行.但如何关闭"我们很抱歉"页面?
Pur*_*gon 76
在config/environments/production.rb中
暂时改变
config.consider_all_requests_local = false
Run Code Online (Sandbox Code Playgroud)
至
config.consider_all_requests_local = true
Run Code Online (Sandbox Code Playgroud)
查看登录log/production.log
.通常这与资产有关,也许你需要放入gem 'therubyracer'
Gemfile.
错误页面由机架中间件中的某些条目显示(我相信ActionDispatch::ShowExceptions
和ActionDispatch::DebugExceptions
).您可以随时将它们添加到您的应用程序中,但可能更容易检查日志."关闭"页面实际上意味着添加内容以显示异常页面.