Here are two examples of the Rails server log for an error I encountered while only changing the Ruby version.
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 the stack trace in the Rails log? It doesn't look like there's a way to view which file/line number to look at.
To assist in investigating, 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
The binding_of_caller
gem in the Gemfile was out of date. I upgraded from 0.7.3
to 0.8.0
and the problem went away.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With