Debugging Ruby on Snow Leopard

Posted by ericp on 2009-11-11 14:43
OS: OS X | Product: Komodo | tags: os x ruby 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

elhombre | Sat, 2010-01-09 15:58

Eric, it sounds like you're getting frustrated with Ruby debugger questions. Will it help to know your assistance is greatly appreciated? This post has solved my problem, especially the suggestion to reload the XCode Dev Tools. Thanks very much.

Wayne

ericp | Mon, 2010-01-11 11:47

Thanks for the note, Wayne. No, I'm not frustrated, more likely
amused by the situation. On the whole, change is inevitable,
and usually a good thing, so I'm happy to help people deal with it.
I just wish it didn't always take me by surprise so often.

- Eric

ed_cardinal | Wed, 2010-02-10 12:42

I'm a new IDE user with Snow Leopard installed, and this fixed worked for me. Thanks!

-- Ed C.

sean.mehan | Mon, 2010-05-24 01:22

Hello.

Kicking the tires on this IDE, running through your docs, etc., and much of it is quite nice. But I can't get the ruby debugger to work. Replicated the first error in this thread, and mv'd 1.8 to 1.8-32. That yielded a different error:

for info:

bash-3.2# ruby -v
ruby 1.8.7 (2009-06-08 patchlevel 173) [universal-darwin10.0]
bash-3.2# pwd
/Applications/Komodo IDE.app/Contents/SharedSupport/dbgp/rubylib
bash-3.2# ls
1.8-32 license.txt rdbgp rdbgp.rb
bash-3.2# uname -a
Darwin lepton-2.local 10.3.0 Darwin Kernel Version 10.3.0: Fri Feb 26 11:58:09 PST 2010; root:xnu-1504.3.12~1/RELEASE_I386 i386
bash-3.2# gem list --local

*** LOCAL GEMS ***

...
ruby-debug-base (0.10.3)
...

and the error now:

uninitialized constant ApplicationController
        /Users/seanskye/code.ruby/komtest/app/controllers/movies_controller.rb:1
/Users/seanskye/code.ruby/komtest/app/controllers/movies_controller.rb:1: uninitialized constant ApplicationController (NameError)

ericp | Tue, 2010-05-25 09:43

Ruby is saying it can't find the rails libraries.

There could be several causes for this, I need
more info.

- Eric

sean.mehan | Tue, 2010-05-25 16:47

Hi, Eric.

Indeed, rails is installed and well used. It is choking for me with this Komodo IDE.

bash-3.2# rails -v
Rails 2.3.6

and

lepton-2:komtest seanskye$ ./script/console
Loading development environment (Rails 2.3.6)
/Library/Ruby/Gems/1.8/gems/rails-2.3.6/lib/commands/console.rb:45:
>>

Just want the debugger to run.

thanks for the attention. I don't know enough about your product to know where to dig for more info.

ericp | Tue, 2010-05-25 17:05

I'm not sure that's the issue.

It looks like there are two Ruby's on your system, one has Rails,
and the one that Komodo's looking at doesn't.

Could you have a look at the preferences in
[Preferences|Languages|Ruby] to see if that's the case?

If you run these commands in the [Run Command] tool, what's
the output

1. echo %ruby

2. which ruby

3. which rails

4. %ruby -e "print $:"

Thanks,
Eric

sean.mehan | Sun, 2010-06-06 13:44

ok, so to be certain, i updated rails to 2.3.8 and then ran your tests, as I thought it odd as this should all be stock:

1. echo %ruby
/usr/bin/ruby

2. which ruby
/usr/bin/ruby

3. which rails
/usr/bin/rails

4. %ruby -e "print$:"
/Library/Ruby/Site/1.8/Library/Ruby/Site/1.8/powerpc-darwin10.0/Library/Ruby/Site/1.8/universal-darwin10.0/Library/Ruby/Site/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby/1.8/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby/1.8/universal-darwin10.0/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/powerpc-darwin10.0/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0.

ericp | Mon, 2010-06-07 09:40

All the spaces got pulled out of your last submission,
so it's hard to tell if $: can see the gems library.

- Eric