Well, last Friday was my day for Panther. Since I pre-ordered it, my disks arrived early in the afternoon. It was one of the most painless upgrades I have ever performed, while having some really great new features. Of course, shortly after my install, I needed to install the latest version of Ruby. I tried (with a lot of help from James Duncan Davidson) to get Ruby 1.8 in Panther, but it was too late. In order to proceed with with the steps below you need to install the xCode developer's tools that come with Panther.
So, here it goes:
1) Make yourself a directory to build your stuff in (like build) and enter that directory.
2) A great tool that comes with Ruby is irb (Interactive Ruby). One really nice thing in irb is using the up arrow to recall previous lines of typed in Ruby code. The problem is this depends on readline which is not included in Panther. So, we need to install readline prior to installing Ruby. You can do it after, but its more of a PITA.
$ curl -o readline-4.3.tar.gz \ ftp://ftp.gnu.org/gnu/readline/readline-4.3.tar.gz $ tar -xzf readline-4.3.tar.gz $ cd readline-4.3 $ perl -i.bak -p -e \ "s/SHLIB_LIBS=.*/SHLIB_LIBS='-lSystem -lncurses -lcc_dynamic'/g" \ support/shobj-conf $ ./configure $ make $ sudo make install password: (your password) $ cd ..
Note: That perl hack was found to fix a linking problem.
3) UPDATED: Now onto my favorite programming language. Ruby 1.8.1 is the current stable release, and it should be the version built. From the command line do the following:
$ curl -o ruby-1.8.1.tar.gz \ "http://rubyforge.org/download.php/262/ruby-1.8.1.tar.gz" $ tar -xzf ruby-1.8.1.tar.gz
4) Build and install Ruby.
$ cd ruby-1.8.1 $ autoconf $ ./configure
Its worth discussing here that when you run ./configure you can specify the prefix for installation with --prefix. It defaults to /usr/local (which is not included in the default path for Panther's terminal). I leave it in /usr/local even though the Ruby that ships with Panther is in /usr so that I can keep the old version around (for Apple updates, etc). Anyway...
$ make $ make test $ sudo make install password: (your password)
5) Update your path to include /usr/local/bin. I am still running tcsh instead of bash (since the Panther upgrade honored my existing shell...thanks Apple!). Anyway, once you do that test out Ruby and verify its installation:
$ ruby -v ruby 1.8.1 (2003-10-24) [powerpc-darwin]
BTW: I am going to try and build a .dmg file of this Ruby build for simple installation by folks that don't want to go through these kind of low-level steps.