删除已经安装的项目:

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

安装依赖:

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

下载Ruby源码并解压缩:

1
2
3
4
5
6
7
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

编译安装:

1
2
3
cd ruby-1.9.3.pXXX
./configure
make && make install

检查安装:

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

参考文章:

留言

2012-08-26
次访问