【译】使用Yum在CentOS上安装Ruby 1.8.6

2012-10-31更新:修改源地址,以前的源地址已经不能使用。

原文:Installing Ruby 1.8.6 on CentOS with Yum

64位系统:

1$ sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
2$ sudo rpm -Uvh http://download.elff.bravenet.com/5/x86_64/elff-release-5-3.noarch.rpm
3$ sudo yum install ruby ruby-shadow ruby-ri ruby-rdoc gcc gcc-c++ ruby-devel -y
4$ ruby -v
5ruby 1.8.6 (2010-02-05 patchlevel 399) [x86_64-linux]

32位系统:

1$ sudo rpm -Uvh  http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
2$ sudo rpm -Uvh http://download.elff.bravenet.com/5/i386/elff-release-5-3.noarch.rpm
3$ sudo yum install ruby ruby-shadow ruby-ri ruby-rdoc gcc gcc-c++ ruby-devel -y
4$ ruby -v

安装RubyGems:

1$ wget http://rubyforge.org/frs/?group_id=126&release_id=43601
2$ tar xzvf rubygems-1.3.7.tgz 
3$ cd cd rubygems-1.3.7
4$ sudo  ruby setup.rb 
5$ gem --version
61.3.7