Install Old Versions of Ports Using MacPorts
MacPorts is my preferred way of installing, managing, and upgrading much of the software I have on my Mac.
I’m setting up a new work machine today and I need to install ruby 1.8.5 on my machine for Rails to be happy.
Unfortunately, you can’t do something simple like specifying the version of the port you want to install unless it’s in a local repository.
Fortunately, my friend Stephen Chu had this problem about a year ago and has a nice procedure on how to do it. I’m going to update it for MacPorts and ruby 1.8.5 here.
1) Find out the svn revision number of the Portfile that has 1.8.5 by looking at:
http://trac.macosforge.org/projects/macports/log/trunk/dports/lang/ruby/Portfile
In my case it is 21127.
2) Set up a local port repository. In the file /opt/local/etc/macports/sources.conf, add this line before the rsync line:
file:///Users/Shared/dports and create that directory.
3) Install the port into your local repository.
4) Run portindex so that ports now finds your new (old) version of ruby.
5) Now you should be able to see ruby @1.8.5-p12 in addition to @1.8.6 by running:
6) Install Ruby
You should be up and running now, so to check, run:
You will see something like this:
Now, if you want versions of ruby that MacPorts doesn’t have (later patchlevels for instance), you can modify the portfiles by hand, but I’ll leave that for another post.












1 Comment
Jump to comment form | comments rss [?] | trackback uri [?]