I'm running ruby-debug with bundle exec rdebug script/server on Rails 2.3. When I press Ctrl-C, it exits the entire program and the debugger. I want it to stop execution of the program and bring me into a debugger session.
I tried catch Interrupt but it didn't work. Is there an exception that gets called when I stop rails with Ctrl-C that would be good to use for this purpose? Or is there another way?
What I want is the equivalent of pressing the Break (pause) button in Visual Studio (I haven't yet done this with a Rails IDE).
I recommend pry over ruby-debug. Install the gem and then you can just stick this into your code where you want to debug:
binding.pry
you should just drop a debugger line in your code, this will automatically create a debugging session.
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