用户友好的错误页面未在生产环境中显示 [英] User-friendly error pages not displaying in production environment

查看:41
本文介绍了用户友好的错误页面未在生产环境中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我的用户友好错误页面停止为我的生产环境显示.我使用的是 rails 3.0.3.

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

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

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

config.action_controller.consider_all_requests_local = false

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

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

有其他人遇到过这种情况吗?

Has anyone else experienced this?

推荐答案

感谢 EngineYard 的 Scott,我找到了解决方案

I found a fix for this thanks to Scott at EngineYard

我把它放在我的 config/environments/production.rb 的开头

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

class ActionDispatch::Request
 def local?
   false
 end
end

这篇关于用户友好的错误页面未在生产环境中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆