为什么Ruby 2.5.0在Rails 5.1.4中没有显示堆栈跟踪?

ard*_*vis 10 ruby ruby-on-rails

以下是我在仅更改Ruby版本时遇到的错误的Rails服务器日志的两个示例.

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'
Run Code Online (Sandbox Code Playgroud)

Ruby 2.5.0,Rails 5.1.4,Puma 3.11.0:

NoMethodError - undefined method `recent' for #<Event:0x00007f8ccc1b9508>:
Run Code Online (Sandbox Code Playgroud)

如何在Rails日志中重新启用堆栈跟踪?看起来没有办法查看要查看的文件/行号.

为了协助调查,我将此添加到我的ApplicationController:

rescue_from Exception do |exception|
  byebug
  1+1
end
Run Code Online (Sandbox Code Playgroud)

Ruby 2.4.2

(byebug) exception.backtrace
# A very large array of paths appears
Run Code Online (Sandbox Code Playgroud)

Ruby 2.5.0

(byebug) exception.backtrace
nil
Run Code Online (Sandbox Code Playgroud)

ard*_*vis 17

binding_of_caller在的Gemfile宝石已经过时.我升级0.7.30.8.0了,问题就消失了.