Ruby which can be installed by yum is 1.8.x for CentOS 6.4.
So, we install ruby 1.9.x from sources.
1. Install epel. Epel is is Extra Packages for Enterprise Linux.
http://www.tooyama.org/yum-addrepo-epel.html
To the using the EPEL yum, we need the following configration.
# vi /etc/yum.repos.d/epel.repo
[epel]
name=Extra Packages for Enterprise Linux 5 - $basearch
#baseurl=http://dl.fedoraproject.org/pub/epel/5/$basearch
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch
failovermethod=priority
enabled=1
2. Install the software for compliling.
sudo yum install --enablerepo=epel make gcc zlib-devel openssl-devel readline-devel ncurses-devel gdbm-devel db4-devel libffi-devel tk-devel libyaml-devel
3 Download and Install
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p429.tar.gz
tar xf ruby-1.9.3-p327.tar.gz
cd ruby-1.9.3*
./configure
make
sudo make install