CentOS 6
Sponsored Link

Ruby 2.1 : Install2015/04/06

 
The version of Ruby in CentOS 6 repository is 1.8 but Install 2.1 with RPM package if you need.
[1] Install development packages first.
[root@dlp ~]#
yum -y groupinstall "Development Tools"
# install from EPEL

[root@dlp ~]#
yum --enablerepo=epel -y install libyaml libyaml-devel readline-devel ncurses-devel gdbm-devel tcl-devel openssl-devel db4-devel libffi-devel
[2] Build RPM and Install Ruby 2.1.
The verion of it in this example is latest Ruby 2.1.5 at April 2015 now.
[root@dlp ~]#
mkdir -p rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}

# get source

[root@dlp ~]#
wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.5.tar.gz -P rpmbuild/SOURCES

# get SPEC file

[root@dlp ~]#
wget https://raw.githubusercontent.com/feedforce/ruby-rpm/master/ruby21x.spec -P rpmbuild/SPECS
[root@dlp ~]#
rpmbuild -bb rpmbuild/SPECS/ruby21x.spec
[root@dlp ~]#
rpm -Uvh rpmbuild/RPMS/x86_64/ruby-2.1.5-2.el6.x86_64.rpm

Preparing...                ################################### [100%]
   1:ruby                   ################################### [100%]

[root@dlp ~]#
ruby -v

ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux-gnu]
[root@dlp ~]#
gem -v

2.2.2
Matched Content