Stepping into your Ruby On Rails code with ruby-debug

I’ve been developing a website with Ruby on Rails since August(more on the choice of the technology later). I like Ruby on Rails the framework a lot so far and it has made me very productive. However, the default debugger breakpointer (ruby script/breakpointer) is somewhat primitive. One of the big minuses is that breakpointer does not provide the functionality to step through your code. I didn’t feel that was a big problem because frankly the output from WEBrick and development.log, together with breakpointer allowed me to diagnose any problems I had until now.

The implementation of PayPal payment for my website changed my requirements and I now need to step through the code to have a better understanding of the payment process, to ensure payments are handled correctly. I dug around the net a little and found ruby-debug. The first version of ruby-debug was developed by Kent Sibilev in July. The current version of ruby-debug has very convenient features such as stepping into or over a line of code, viewing the code, saving your breakpoints to a file, etc. It has made my life a lot easier.

I’m currently running Ubuntu Dapper Drake and the installation of ruby-debug is very easy if you install Ruby on Rails using the checkinstall method mentioned here:

sudo gem install ruby-debug

You shouldn’t need to install the ruby-dev package as mentioned in the ruby-debug tutorial. My guess is that the checkinstall method includes the installation of ruby-dev.

My thanks to Ken for developing this wondering debugger!

Update: my website is finally live at UberSquare.com.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s