Radio Bantik:
Days in the Life of an Alpha Geek

Radio Bantik is an alpha-geek blog covering topics in Mac OS X, software and web development including Ruby on Rails, Java, Cocoa, and WebObjects, corporate survival, LEGO robotics, and other stuff important in the life of a technologist.

Post-Migration Ruby Leopard Blues

Posted February 3rd, 2008 in Apple, Development, Ruby on Rails | Permanent Link

I finally finished migrating everything over from my old desktop to my new iMac. (I’m still amazed that a consumer-level Mac is more than twice as fast as my old high-end desktop… such is the pace of hardware, of course.)

At any rate, when I started working on one of my Rails projects, I was surprised to see that performance was really poor– much slower that on the old box. Then I realized that my Ruby and Rails installations probably got migrated by Migration Assistant.

Sure enough, ruby -v in Terminal revealed Ruby 1.8.6 for PowerPC/Darwin. This means that Ruby is running in PPC emulation, which explains the performance I was seeing.

Since Leopard ships with Ruby, this means that I now have two versions: in /usr/bin/ruby there’s the version that came with the OS, which is

ruby 1.8.6 (2007-06-07 patchlevel 36) [universal-darwin9.0]

In /usr/local/bin/ruby there’s:

ruby 1.8.6 (2007-03-13 patchlevel 0) [powerpc-darwin8.10.0].

This is obviously a problem…

Some Google time later, I came across this post on Punctuated Productivity; that set me in the right direction for uninstalling the old version and getting the new one up to snuff. His approach was to completely wipe /usr/local/bin and /opt/, which I found a little scary. Here’s a slightly more surgical approach.

  1. Remove the following from /usr/local/bin (sudo, of course):

    gem*
    update_rubygems
    rails
    rake
    mongrel-rails
    cap
    capify
    gpgen
    index_gem_repository.rb
    libpng-config

  2. Unfortunately, I had just installed and configured ImageMagick on the old box, which is a long and tricky process that I’ll have to do all over again. But since it was the only thing that I had installed on that day, so I was able to open ./ to open /usr/local/bin in the Finder, sort by date, and select/delete all of the ImageMagick and RMagick files in a couple of clicks:

    Magick-config
    Wand-config
    animate
    compare
    composite
    conjure
    convert
    display
    freetype-config
    identify
    import
    libpng12-config
    libwmf-config
    libwmf-fontmap
    mogrify
    montage
    pkg-config
    stream
    wmf2eps
    wmf2fig
    wmf2gd
    wmf2svg
    wmf2x
    libpng-config

  3. My last uninstall step was to delete /opt after all, because only MacPorts (which I used to install ImageMagick) had put anything in there.
  4. Now hash -r followed by which ruby correctly reveals /usr/bin/ruby, and ruby -v reports ruby 1.8.6 (2007-06-07 patchlevel 36) [universal-darwin9.0]

    Now to reinstall Rails:

    sudo gem install rails --include-dependencies

    Next I have to reinstall ImageMagick and RMagick, which will hopefully be less painful this time around now that I know about MacPorts…


Leave a Reply