Rails 4中显示语法错误

3
当我使用Rails 3和Slim时,所有的Slim语法错误都会在浏览器中显示,但当我迁移到Rails 4后,Slim语法错误只在控制台中显示。在浏览器中,我只看到HTTP 500错误和消息We're sorry, but something went wrong。如何在浏览器中显示语法错误?
例如,如何显示此错误而不是HTTP错误500:
Started GET "/tests" for 127.0.0.1 at 2014-01-09 14:44:55 +0400
Processing by TestsController#index as HTML
  Rendered tests/index.html.slim within layouts/application (2.2ms)
Completed 500 Internal Server Error in 5ms

ActionView::Template::Error (Text line not indented deep enough.
The first text line defines the necessary text indentation.
Are you trying to nest a child tag in a tag containing text? Use | for the text block!
  /Users/sergey-chechaev/rails/project/test_rails_4/app/views/tests/index.html.slim, Line 2, Column 1
    p = week_field_tag :week

2
你是在生产环境还是开发环境下运行你的应用程序? - Marek Lipka
开发环境 - Sergey Chechaev
TestRails4::Application.configure do config.cache_classes = false config.eager_load = false config.consider_all_requests_local = true config.action_controller.perform_caching = false config.action_mailer.raise_delivery_errors = false config.active_support.deprecation = :log config.active_record.migration_error = :page_load config.assets.debug = true end - Sergey Chechaev
我有同样的问题。@SergeyChechaev,你找到解决方法了吗? - Dominik Goltermann
我没有发现我在使用终端。 - Sergey Chechaev
显示剩余4条评论
1个回答

4
在开发模式下,由于目前存在一个问题,浏览器中不会显示Slim的语法错误。看起来在引发异常时Rails 4和Slim之间存在通信问题。
请关注正在进行的讨论,请访问Github Slim问题页面

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接