The new ruby has some interesting new features, and I am hot to try them out. I’ve got Leopard installed, which comes with ruby 1.8.6, so I guess we could replace that. However, it’s generally a good idea to leave that stuff be.
So, I am going to installed it somewhere else. The ruby that comes with Leopard is installed in /usr/bin
which ruby
I am going to put my new 1.8.7 in /usr/local/bin
First I downloaded it: ruby-1.8.7.tar.gz
Then, I opened up my terminal and:
mv ~/Downloads/ruby-1.8.7.tar.gz ~/src && cd ~/src tar xvzf ruby-1.8.7.tar.gz cd ruby-1.8.7 ./configure --enable-shared --enable-pthread --prefix=/usr/local make make test sudo make install
Make sure /usr/local/bin is at the begining of your PATH environment variable. You can now play around with ruby 1.8.7! You will most likely want to reinstall rubygems in /usr/local as well.