Install Ruby 1.8.7 from sources in Centos 5.5

Centos 5.5 official repository is rather outdated for today so the latest Ruby available there is 1.8.6. If you need a newer version e.g. 1.8.7 you should install if from sources:

0. Install prerequisites:

sudo yum install gcc zlib zlib-devel

1. Download the latest version of Ruby from project’s FTP:

cd /usr/src/
sudo -s
tar -xvzf ruby-1.8.7.tar.gz
cd ruby-1.8.7
./configure --enable-pthread
make install

2. Check ruby’s version is 1.8.7:

[root@li110-222 ~]# /usr/local/bin/ruby -v
ruby 1.8.7 (2008-05-31 patchlevel 0) [i686-linux]

That’s it!


Stefan Durand

My name is Stefan, I'm the admin of LinuxScrew. I am a full-time Linux/Unix sysadmin, a hobby Python programmer, and a part-time blogger. I post useful guides, tips, and tutorials on common Linux and Programming issues. Feel free to reach out in the comment section.

Leave a Reply

Your email address will not be published. Required fields are marked *