atmorell
atmorell

Reputation: 3068

Rails3: Drop to debugging console on any exception/crash

Is it possible to automatically drop to the Ruby debugger if there is any kind problem with the application?

gem 'debugger', :git => 'https://github.com/cldwalker/debugger.git' 

At the moment I have to go through my code, and add the debugger statement and sometimes also go through loops etc. to find where the code crashes. This is very time consuming and very slow troubleshooting. So basically I want the debugging console right after the Application traceback has been generated.

.. Exception Caught ..

app/admin/watchlists.rb:135:in `open'
app/admin/watchlists.rb:135:in `entries'
app/admin/watchlists.rb:135:in `block (4 levels) in <top (required)>'

Upvotes: 2

Views: 115

Answers (1)

aceofspades
aceofspades

Reputation: 7586

You can get an irb session by using hijack.

Upvotes: 1

Related Questions