Install Ruby 1.9.2 on Ubuntu

By | July 30, 2020

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 ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p0.tar.bz2
$ 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

AND RUBY 1.9.2 IS INSTALLED!

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

Cheers!!

About Silver Moon

A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at [email protected].

4 Comments

Install Ruby 1.9.2 on Ubuntu

Leave a Reply

Your email address will not be published. Required fields are marked *