Rails debugging triggers an internal error message

Posted by ericp on 2009-09-21 08:49
OS: All / Any | Product: Komodo | tags: rails debugging

When I try to debug Rails apps or unit tests in Komodo, I get an error message "INTERNAL ERROR!!! You have a nil object when you didn't expect it!" instead of breaking.


The problem is that a couple of Rails files are now loading ruby-debug-base whether it's requested or not. The result is that a mixture of objects in the Debugging module are loaded, and they conflict.

I submitted a patch at https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2895 requesting that Rails loads the debugging environment only if it hasn't been loaded yet. I don't know if the patch has been applied to trunk yet, but it's an easy fix:

Find the two files in either your gem or vendor area:


Find these lines:

rescue LoadError
  # Debugging disabled. `gem install ruby-debug` to enable.

and change the 'end' to

end unless defined? Debugger