How to install Ruby 1.8.7 and Rubygem 1.8 on Centos 5.7

As RedHat OpenShift client tool requires minimum Ruby 1.8 and and Rubygem 1.8.
The official OpenShuft.repo only catered for RHEL 6 and above, but my Virtual Private Server is running on Centos 5.7.

yum install ruby in CentOS 5.7 will have the old Ruby 1.8.5.

Here is the steps on how to install Ruby 1.8.7 and Rubygem 1.8 on Centos 5.7.

First, get the Ruby 1.8.7 from the official site.

# wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.gz
# tar -zxvf ruby-1.8.7-p330.tar.gz
# cd ruby-1.8.7-p72
# ./configure –prefix=/usr
# make
# make install

Run, ruby -v to verify.

# ruby -v

Then, follow by install RubyGems

# wget http://rubyforge.org/frs/download.php/74806/rubygems-1.8.0.tgz
# tar -zxvf rubygems-1.8.0.tgz
# cd rubygems-1.8.0
# ruby setup.rb

Lastly, run gems -v to verify.

# gems -v
Posted in Linux Tagged with: , ,

Leave a Reply