Hurrahhh! breakpoints reactivated

Rails framework offers breakpoints in application. Unfortunately, to all developers from some time they don’t work, since they relay on ruby-breakpoint library, which is not maintained anymore. However there is available replace: ruby-debug.

So go to Data Noise for usage instructions. Works for me (however I had some quirks, which have suddenly disappeared, I won’t cry for them :) ). In comments to post linked above are detailed, step-by-step instruction how to setup new debugger environment. Here is quote from this comment:

For reference, here’s how I got it working:

1) Add this 2 lines to development:

require 'ruby-debug' 
Debugger.start

2) stop and start with ./script/server webrick

3) put “debugger” on the line where you want the code execution to stop.

4) Run the code from the browser and go back to terminal. You should see something like (rdb:2) on the last line

5) type “irb”. You should now have everything at your fingertips! (You could also type “help” to see all available commands).

It works only with webrick as server, but in development environment it is no issue, at least for me.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.