i have the apples development environment installed (that used to be a requirement to get a fully functional version of gcc… not sure if that is the case any more) so i just do the following:
cd to where i want it downloaded it in terminal, and then type the folowing
curl ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.gz -o ruby-1.8.7-p72.tar.gz
tar zxvf ruby-1.8.7-p72.tar.gz
sudo make install
you will need to type a password for sudo. configure might complain about things it can’t find or are not current. you might have to install other things. eg: apples bison/yacc is a common thing complained about since it is/was a lot older then most things want.
if you ask for help from configure, it will tell you (among other things) that:
By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc. You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.
thus if you do a:
if it doesn’t come back saying /usr/local/bin/ruby and instead says /usr/bin/ruby then you need to change your path to use the one in /usr/local/bin. i would advise against replacing the one in /usr/bin since that is updated by apple.
also, ruby-1.8.7-p72.tar.gz is currently the “current” version… that might change in the future. changing your path might have some other impacts, if you have overlapping software in /usr/local/bin vs /usr/bin. for example, i have gem and others installed in /usr/local/bin. lastly, you will probably have to reinstall gems that you have installed already.
this solution is not for everyone, since it means your getting more involved in the management of software on the machine. i like it because it means, i know what software is on the machine, and also when it is updated… because i do the updating.
hope that helps.