How to install a specific software version using Mac Ports
MacPorts is the preferred way of installing, managing, and upgrading ports of some the software I have on my Mac. Unfortunately mac ports does not let you specify a version. To mediate this you can create a local repository that is checked out to a specific version and install from there.
This example is how to install ruby version 1.8.5-p12.
1) Find out the svn revision number of the Portfile by looking in:
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.
http://svn.macports.org/repository/macports/trunk/dports/lang/ruby/
lang/ruby/
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: