Ruby 1.8.7 on MacPorts causing some problems

It appears that MacPorts has upgraded to Ruby 1.8.7, which is good news if you’re running Rails 2.1… but if you have an older Rails application… it’s not going to work too well.

In order to get Ruby 1.8.6 installed with the latest MacPorts, you’ll need to do the following.

```bash
$ mkdir /Users/Shared/dports


```bash

$ svn checkout -r 36429 \ http://svn.macports.org/repository/macports/trunk/dports/lang/ruby/ \ /Users/Shared/dports/lang/ruby/

Then you’ll need to modify your macports to use this new local source. You’ll need to edit /opt/local/etc/macports/sources.conf and add the following line above the existing rsync record.

file:///Users/Shared/dports and create that directory

Next, you’ll want to index this new local source with the following command:

portindex /Users/Shared/dports

After that, you can do the following.

sudo port uninstall rb-rubygems ruby

sudo port clean rb-rubygems ruby

sudo rm -r /opt/local/lib/ruby/gems/1.8/doc/rubygems-1.1.1/

sudo port deactivate autoconf

sudo port install ruby rb-rubygems

..and hopefully you’ll have Ruby 1.8.6 installed and be able to retain the rubygems you installed already.

Hi, I'm Robby.

Robby Russell

I run Planet Argon, where we help organizations keep their Ruby on Rails apps maintainable—so they don't have to start over. I created Oh My Zsh to make developers more efficient and host the Maintainable.fm podcast to explore what it takes to build software that lasts.