Skip to Main Content

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

 

Most RecentRSS

ArchiveRSS

March 2016 (1)
January 2016 (1)
September 2015 (1)
May 2015 (1)
April 2015 (1)
March 2015 (1)
February 2015 (2)
January 2015 (5)
September 2014 (2)
August 2014 (4)
July 2014 (1)
March 2014 (1)
November 2013 (3)
September 2013 (3)
July 2013 (6)
June 2013 (1)
May 2013 (1)
March 2013 (2)
February 2013 (3)
January 2013 (4)