Install Ruby 1.8.7 On CentOS 5.9 Using Yum

Written by tag Friday, 04 October 2013 15:48

Print

Create New Ruby Repository File

Use your text editor to open a new file for editing in the /etc/yum.repos.d/ directory called kbs-el5-rb187.repo and add the below contents to the file.

[kbs-el5-rb187]
name=kbs-el5-rb187
enabled=1
baseurl=http://centos.karan.org/el$releasever/ruby187/$basearch/
gpgcheck=1
gpgkey=http://centos.karan.org/RPM-GPG-KEY-karan.org.txt

NOTE: The ruby packages in this repo are built to replace the system ruby, and will drop into the default systemwide path. You might want to consider what implications this might have on your existing installed apps and ruby components.

Using Yum Package Manager

After saving the file you created above you can go ahead and install Ruby using syntax similar to the below which will install Ruby and any necessary dependencies.

# yum install ruby rubygems

That is all you have to do. Ruby 1.8.7 is now installed on your server.
To add Sass and Compass support for your Ruby run

# gems install sass
# gem install compass

When done, restart your apache server and start using Sass.