用户友好的错误页面在生产环境中不显示

发布于 2024-10-10 12:17:27 字数 269 浏览 0 评论 0原文

最近,我的生产环境中停止显示用户友好的错误页面。我正在使用 Rails 3.0.3。

我的 config/environments/development.rb 中有以下内容:

config.action_controller.consider_all_requests_local = false

当我使用生产环境在本地启动 Web 服务器时,用户友好的错误页面会正确显示。

还有其他人经历过吗?

Recently my user friendly error pages stopped displaying for my production environment. I am using rails 3.0.3.

I have the following in my config/environments/production.rb:

config.action_controller.consider_all_requests_local = false

When I start my web server locally using the production environment, the user-friendly error pages display properly.

Has anyone else experienced this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

豆芽 2024-10-17 12:17:27

感谢 EngineYard 的 Scott,我找到了解决此问题的方法,

我将其放在 config/environments/production.rb 的开头

class ActionDispatch::Request
 def local?
   false
 end
end

I found a fix for this thanks to Scott at EngineYard

I put this at the beginning of my config/environments/production.rb

class ActionDispatch::Request
 def local?
   false
 end
end
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文