Wed Nov 17 14:49:14 EET 2010

Update to the latest ruby release from source in Debian Lenny

Debian Lenny's default package included with this distro repository is 1.8.7
Since some ruby project code requires a newer release of ruby as of 1.9.2, I needed to update the ruby version installed on one of the Debian Lenny Linux servers I'm administrating.

I couldn't find a way to make the ruby update to version 1.9.2 via a deb package thus I proceeded further and installed a ruby 1.9.2 from source into /usr/local/bin

By installing the newer release to /usr/local/bin, I'm not harming the old ruby install and I still keep the advantages of having the newer 1.9.2 installed :)

The installation from source comes to this easy steps:

1. Download the latest ruby source in my case this is ruby-1.9.2-p0.tar.bz2

debian:~# cd /usr/local/src
debian:/usr/local/src# wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p0.tar.bz2
...


2. Dearchive the ruby source package

debian:/usr/local/src# tar -jxvvf ruby-1.9.2-p0.tar.bz2
debian:/usr/local/src# cd ruby-1.9.2-p0


3. Compile the ruby source and install it
debian:/usr/local/src/ruby-1.9.2-p0# make
...
debian:/usr/local/src/ruby-1.9.2-p0# make install


Further on if you need to change your Apache to start using the newer installed version of ruby you will need to set the following variable in /etc/apache2/apaache2.conf

RailsRuby /usr/local/bin/ruby