CentOS 6
Sponsored Link

Install Ruby 2.02013/12/09

 
The version of Ruby in CentOS 6 repository is 1.8 but Install 2.0 with RPM package if you need.
[1] It's possible to install from CentOS SCLo Software Collections.
It's OK to install it even if 1.8 is already installed because 2.0 is located on another PATH.
# install from SCLo

[root@dlp ~]#
yum --enablerepo=centos-sclo-rh -y install ruby200
[2] Packages from Software Collections are installed uder the /opt directory.
To use it, Load environment variables like follows.
# load environment variables

[root@dlp ~]#
scl enable ruby200 bash
[root@dlp ~]#
ruby -v

ruby 2.0.0p645 (2015-04-13) [x86_64-linux]
[root@dlp ~]#
which ruby

/opt/rh/ruby200/root/usr/bin/ruby
[3] If you'd like to enable Ruby 2.0 automatically at login time, configure like follows.
[root@dlp ~]#
vi /etc/profile.d/ruby200.sh
# create new

#!/bin/bash

source /opt/rh/ruby200/enable
export X_SCLS="`scl enable ruby200 'echo $X_SCLS'`"
Matched Content