Last Updated: February 25, 2016
·
1.725K
· akalyaev

Full backtrace for SystemStackError

When debugging "SystemStackError: stack level too deep" exceptions, it is not helpful that the backtrace is reduced to one single line. Most of the time Ruby incorrectly identifies where cycles begin, resulting in an unrelated "file:line" as the backtrace.

Example:

gems/equalizer-0.0.7/lib/equalizer.rb:57: stack level too deep (SystemStackError)

If you want Ruby to print the whole backtrace, you need to patch it. Here is the patch

Install it (RVM):

$ rvm reinstall you-ruby-version --patch /path/to/stack-overflow.patch

Credits