this is totally gonna work… » Blog Archive » Ruby and Leopard

Ruby and Leopard

I’ve spent the bulk of this week trying to dig myself out of Ruby/Leopard hell. I’m surprised that things were as borked as they were. So much so, that I’m inclined to believe that there was something special happening on my machine. I got my shiny new Leopard install the day after it came out. I did an upgrade (not a clean install) with no hiccups and was happy with all of my shiny happy new Leopard features. I knew that first-class Ruby support was coming so I figured I would abandon my MacPorts install and go with what Mr. Jobs deigned to give me.

At first things seemed to go well. But as I was spooling up again on my “Programming Collective Intelligence” project, autotest with rspec was just flat-out broken. When I ran autotest I would get an error like the following:

/Library/Ruby/Gems/1.8/gems/rspec-1.0.8/lib/autotest/rspec.rb:80:in spec_command': No spec command could be found! (RspecCommandError)
    from /Library/Ruby/Gems/1.8/gems/rspec-1.0.8/lib/autotest/rspec.rb:10:in initialize’
    from /Library/Ruby/Gems/1.8/gems/ZenTest-3.6.1/lib/autotest.rb:123:in new'
    from /Library/Ruby/Gems/1.8/gems/ZenTest-3.6.1/lib/autotest.rb:123:in run’
    from /Library/Ruby/Gems/1.8/gems/ZenTest-3.6.1/bin/autotest:48
    from /usr/bin/autotest:16:in `load’
    from /usr/bin/autotest:16

After lots of digging, I figured out that autotest uses the built-in Config class which defines a bindir that rspec (with autotest) uses to derive possible locations for the spec command. On Leopard the default ‘bindir’ for Leopard was /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin which was not where the spec command was installed. With a little help from a blog post I simply symlinked spec into that impossibly long path and things seemed to work.

For now I’m sticking with the Leopard install. I’ve fiddled a little bit with the Scripting Bridge stuff and it’s pretty nifty so I’m hesitant to abandon the Apple install. I just hope that Ruby support doesn’t rot the same way Java support has.

This entry (Permalink) was posted on Thursday, December 6th, 2007 at 12:11 am and is filed under Mac, Ruby. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response , or trackback from your own site.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>