Installing Ruby 1.9.3 on RedHat 6

Ruby 1.9 isn’t available through yum on Red Hat Enterprise Linux 6, per this page:
https://access.redhat.com/site/solutions/131923

No need to worry though. You can still get Ruby onto Red Hat using rvm (Ruby Version Manager).
First, a bit of prep:

yum -y install gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel

Next, download the stable release:

curl -L get.rvm.io | bash -s stable

Pull the variables into your environment:

source /etc/profile.d/rvm.sh

Install Ruby:

rvm install 1.9.3
rvm gemset use global

If you already had an older version installed (the repos ship 1.8.5), tell the system which one to use by default:

rvm use 1.9.3 -default

You should get:

Using /usr/local/rvm/gems/ruby-1.9.3-p545

Check it:

ruby -v

You should get:

ruby 1.9.3p545 (2014-02-24 revision 45159) [x86_64-linux]

That’s it.