Strange problems with ruby-debug (rdebug) after installation of Ruby Enterprise (REE)

Some of us had some troubles with ruby-debug after upgrading to Ruby Enterprise Edition.  One of the issues was with ‘debugger’ statements within the source code causing the debugger to break, but to report line numbers multiplied by two!

To ensure you have a clean installation of ruby-debug that works alongside your shiny REE installation, follow these steps:

Remove all of the ruby-debug gems (including all versions if there’s more than one, and all executables):

sudo gem uninstall ruby-debug

Remove all of the ruby-debug-base gems (including all versions if there’s more than one):

sudo gem uninstall ruby-debug-base

Check there are no other rdebug executables lying around:

whereis rdebug

Remove any that you find

sudo rm /usr/bin/rdebug

Reinstall ruby-debug using the Ruby Enterpise Edition gem installer:

sudo /usr/local/bin/gem install rub

Running remote rdebug in client-server mode

I’m still trying to get rdebug to debug my script/server on a remote machine from Textmate and still no luck.  However, I had another play with rdebug and have finally managed to get the client-server mode working. I never managed to find any blog posts that worked for me, so hopefully this will work for you!

On the server (from your Rails application root directory)
rdebug -sw ./script/server

On your local machine

Just as a reference I’m running ruby-debug 0.10.1 as a gem on OS X 10.5.4.