Install ruby 1.9.x in Cent OS 6.4

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.

rpm -ivh epel-release-5-4.noarch.rpm

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


http://shogogg.hatenablog.jp/entry/2012/12/20/005059