Rails 4 exception stack traces don't show in development

前端 未结 10 1597
星月不相逢
星月不相逢 2021-02-19 18:52

I\'m following the rails tutorial book and using the c9.io web IDE as I follow the tutorials. While working on my sample application, I noticed that exceptions aren\'t being sho

相关标签:
10条回答
  • 2021-02-19 19:31

    Add this in your application.html.erb file. It should provide you more details

    <%= debug(params)%>
    
    0 讨论(0)
  • 2021-02-19 19:31

    In my case, just putting config.consider_all_requests_local = true did make puma show all of errors and full backtrace.

    0 讨论(0)
  • 2021-02-19 19:33

    I got the same error in a Rails 4 app migrated to Rails 5 app.

    Running WEBrick on dev mode and config.consider_all_requests_local = true. Turns out the gem 'web-console'; Using 'bundle update web-console' does not work if the Gemfile is a specific version. So I have to manually change it and update.

    0 讨论(0)
  • 2021-02-19 19:36

    Meanwhile, I was able to find the source of the problem in my case, though still not the solution.

    I'm using the rollbar-gem extension to be able to post errors in production, which actually seems to suck up all error logs also in development (even though it has been manually disabled). Thus removing the gem and all code gives me access to my logs again.

    I posted an issue on this on the gems page.

    0 讨论(0)
  • 2021-02-19 19:36

    I suggest use another way to show errors instead of use the default of Rails.

    I caught the same problem and tried everything, but the gem better_errors saved the day.

    In your Gemfile you can use

    group :development, :test do # I use that only in dev
      gem "better_errors"
      # dependency
      gem "binding_of_caller"
    end
    
    0 讨论(0)
  • 2021-02-19 19:44

    Try to update your web-console gem.

    bundle update web-console
    
    0 讨论(0)
提交回复
热议问题