snow leopard

Debugging Ruby on Snow Leopard

Question: 

I recently upgraded my Mac to Snow Leopard, and now when I try to debug Ruby I get a message like this:

Error: dlopen(/Applications/Komodo IDE.app/.../ruby_debug.bundle,
no suitable image found. Did find:
/Applications/Komodo IDE.app/.../ruby_debug.bundle:
mach-o, but wrong architecture

How do I debug again?

Answer: 

Yes, it's Yet Another Ruby Debugging question.

Snow Leopard is essentially a 64-bit machine, and the
ruby-debug-base gem that ships with Komodo is 32-bit.

The best thing to do is to rename the directory in
/Applications/Komodo IDE.app/Contents/SharedSupport/dbgp/rubylib/
from "1.8" to "1.8-32"

and the install and build the appropriate ruby-debug-base gem
with this command:

sudo gem install ruby-debug-base

You might not be out of the woods yet. If you get an error message
complaining that header files can't be found, you probably need
to install the XCode Dev Tools.

-- Eric