Install Ruby 1.9.2 on Ubuntu

As you all know Ruby is one of the most popular programming language on the web. It is recommended to install ruby 1.9.2 instead of 1.8.x

I tried to install ruby from the package manager on Ubuntu, but ruby 1.9.2 is not there in the repo.

So, I am going to show you how to install ruby 1.9.2 on Ubuntu

Step 1 -

Fire up the terminal and execute these few commands -

$ sudo apt-get install build-essential zlib1g zlib1g-dev libruby1.9.1 libxml2 libxml2-dev libxslt1-dev
$ sudo apt-get build-dep ruby1.9.1
$ wget
$ tar xvjf ruby-1.9.2-p0.tar.bz2

Step 2
Open ruby-1.9.2-p0/ext/Setup and uncomment the zlib line.

Step 3
Now, simply configure, compile and install it! -

$ ./configure
$ make
$ sudo make install


To check the ruby version -

$ ruby -v
=> ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]

To check the rubygems version -

$ gem -v
=> 1.3.7

Hope this quick tip will help many Ubuntu users who want to install ruby 1.9.2


Last Updated On : 28th May 2011

Subscribe to get updates delivered to your inbox

4 Comments + Add Comment

  • Worked for me! Tks a lot!

  • Thanks !

  • thanks man,

    good instructions, useful post.

    thanks for your time.


  • Eh… THANKS!!!! :D

Leave a comment