删除已经安装的项目:

yum erase ruby ruby-libs ruby-mode ruby-rdoc ruby-irb ruby-ri ruby-docs

安装依赖:

yum -y install zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel mysql-devel

下载Ruby源码并解压缩:

cd ~/Downloads  #进入下载目录
lftp ftp.ruby-lang.org
lftp ftp.ruby-lang.org:/> cd /pub/ruby
lftp ftp.ruby-lang.org:/pub/ruby>
lftp ftp.ruby-lang.org:/pub/ruby> get ruby-1.9.3.pXXX.tar.gz  # 2012-08-26,XXX为194 
lftp ftp.ruby-lang.org:/pub/ruby> exit
tar zxvf ruby-1.9.3.pXXX.tar.gz

编译安装:

cd ruby-1.9.3.pXXX
./configure
make && make install

检查安装:

ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

参考文章: