简体   繁体   English

Rails 3.2.3最终用户错误消息,而不是在开发模式下使用think_all_requests_local = true的开发人员错误消息

[英]Rails 3.2.3 End user error messages instead of developer error messages in development mode with consider_all_requests_local = true

I am running my rails 3.2.3 app in development mode. 我正在开发模式下运行Rails 3.2.3应用程序。 Even though I have specified 即使我已经指定

config.consider_all_requests_local = true

in my config/environments/development.rb configuration file, I get the "end user friendly" error pages with the red "We're sorry, but something went wrong." 在我的config/environments/development.rb配置文件中,出现“最终用户友好”错误页面,并带有红色的“很抱歉,出现了问题”。 when I have errors in my views, instead of the more useful "developer friendly" error pages with stack trace, etc. 当我在视图中出现错误时,而不是使用堆栈跟踪等更有用的“对开发人员友好”的错误页面。

What can I do to get the developer friendly error messages? 我该怎么做才能获得开发人员友好的错误消息?

Among my gems are omniauth and slim 我的宝石中有omniauth和苗条

Edit: The problem occurs when there are errors in views. 编辑:视图中有错误时,会发生问题。 When there are errors in controllers, the developer-friendly errors show correctly. 当控制器中存在错误时,将正确显示对开发人员友好的错误。

Have had exactly the same problem, described in the question in the bottom. 发生了完全相同的问题,在底部的问题中进行了描述。 Only saw this message in views, although development mode is and consider_all_requests_local is on. 尽管开发模式为开,并且think_all_requests_local已启用,但仅在视图中看到此消息。 In addition, my file did not contain any illegal utf-8 characters (or was marked via encoding: utf-8). 此外,我的文件没有任何非法的utf-8字符(或通过编码标记为utf-8)。

But today, I finally found the solution for my problem - hope it helps you: 但是今天,我终于找到了解决我问题的方法-希望它能对您有所帮助:

Rails doesnt log tempalte errors in development mode Rails不会在开发模式下记录临时错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Rails think_all_requests_local与Rails.env.development是否相对? - Rails consider_all_requests_local vs. if Rails.env.development? 为rspec测试rails临时设置Conside_all_requests_local - Setting consider_all_requests_local temporarily for rspec testing rails config / environments / development.rb中“consideration_all_requests_local”的用途? - Purpose of “consider_all_requests_local” in config/environments/development.rb? 使用 rspec .think_all_requests_local = false 进行测试 - Testing with rspec .consider_all_requests_local = false 如何在Rails 3.2.3中局部化一般错误消息? - How to localize a generic error messages partial in Rails 3.2.3? Ruby on Rails 4-config.consider_all_requests_local =生产环境中为true - Ruby on Rails 4 - config.consider_all_requests_local = true in production Rails 3.2.3和json中的Flash消息 - Flash messages in Rails 3.2.3 and json 即使config.consider_all_requests_local = false,Heroku也会显示完整的Rails错误页面 - Heroku displaying full Rails error page even though config.consider_all_requests_local = false 开发模式发生问题时,rails会在视图中启用调试错误消息 - rails enable debug error messages in views when something goes wrong in development mode Rails 4删除了一些验证错误消息,但不是全部 - Rails 4 remove some validation error messages but not all
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM