Install Ruby from source - Centos 6
Install the required dependencies:
$ yum -y groupinstall "Development Tools"
$ yum -y install openssl-devel
Download, compile, and install Ruby 2.2.1:
$ cd /tmp
$ wget http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.1.tar.gz
$ tar xvfvz ruby-2.2.1.tar.gz
$ cd ruby-2.2.1
$ ./configure
$ make # this will take a while
$ make install
Update gems:
$ gem update --system # updates rubygems itself
$ gem install bundler
$ gem update # updates default gems
Check that Ruby and Rubygems are installed:
$ ruby --version # 2.2.1
$ gem --version # 2.4.6
Finally, clean up:
$ rm -rf /tmp/ruby-2.2.1
$ rm -f /tmp/ruby-2.2.1.tar.gz
And now you can...
$ irb
irb(main):001:0> puts "Hello #{ENV['HOSTNAME']}"
Hello plato
=> nil