Why doesn't Ruby 2.5.0 show stacktrace in Rails 5.1.4?

Here are two examples of the Rails server log for the error I encountered while changing the version of Ruby.

Ruby 2.4.2 , Rails 5.1.4, Puma 3.11.0:

NoMethodError - undefined method `recent' for #<Event:0x00007f08507bf8b8>: path/to/show.html.haml:50:in `block in _path_to_show_html_haml___4224769623360811234_28796540' path/to/show.html.haml:30:in `_path_to_show_html_haml___4224769623360811234_28796540' 

Ruby 2.5.0 , Rails 5.1.4, Puma 3.11.0:

 NoMethodError - undefined method `recent' for #<Event:0x00007f8ccc1b9508>: 

What can I do to re-enable stack tracing in the Rails log? This is not like the way to view the file / line number you need to look at.

To help with the investigation, I added this to my ApplicationController :

 rescue_from Exception do |exception| byebug 1+1 end 

Ruby 2.4.2

 (byebug) exception.backtrace # A very large array of paths appears 

Ruby 2.5.0

 (byebug) exception.backtrace nil 
+5
source share
1 answer

The binding_of_caller jewel in the Gemfile is deprecated. I upgraded from 0.7.3 to 0.8.0 and the problem disappeared.

+7
source

Source: https://habr.com/ru/post/1274794/


All Articles