CentOS 6
Sponsored Link

Install Ruby 1.92013/02/20

 
The version of Ruby in CentOS 6 repository is 1.8 but Install 1.9 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 1.9 is located on another PATH.
# install from SCLo

[root@dlp ~]#
yum --enablerepo=centos-sclo-rh -y install ruby193
[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 ruby193 bash
[root@dlp ~]#
ruby -v

ruby 1.9.3p484 (2013-11-22) [x86_64-linux]
[root@dlp ~]#
which ruby

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

#!/bin/bash

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