Installing ruby on linux

The following are the steps that I performed to install ruby on my
machine. This same text is also available on
I went to There I found out a
section with the heading Ruby Source Code
I pick the url of the link for the file using the right click and
choosing the 'copy link location' in my firefox.
Then I went to the shell on my linux and put the following command


This downloaded the ruby source code to my root directory. I
the file using the following command

tar -xvf ruby-1.8.7-p72.tar.gz

This command extracted the source archieve to ruby-1.8.7-p72
Then I enter into this ruby-1.8.7-p72 directory and executed the
following command


This is actually not a command rather a script, that is run to check
required configurations for the installation purposes. At the
run of this script I executed the following command


This make command compiled the code. At the end of the make command I
executed the following command

make install

This make install command installed the ruby and placed the ruby
in appropriate folders.
Thats all to what I did for installing ruby on a linux machine.
You can confirm your ruby installation by using the following command

muasif80 wrote:

My newsreader does not break long addresses with ... , so something in this maze of servers did it. Consider a "tiny url" alternative there.

> tar -xvf ruby-1.8.7-p72.tar.gz
This command extracted the source archieve to ruby-1.8.7-p72

To avoid this level of detail, I would link out to a reliable page that explains the common ways to build a GNU package.

> make install
> ruby -v

Now you need rubygems, which is the only gem which you (naturally) must install by hand. However, the install procedure for a Ruby extension differs from the normal GNU in subtle ways, so you should cover this _in_ detail!

Next, I always like ruby-tk, for a super portable GUI toolkit, but you need to enable it back at ./configure

And why aren't you installing your Ruby from your Linux distro's packages, first. That is almost always the safest newb way.

And some Linuces put their user-space programs under /usr, and some under /usr/local. That requires the correct ./configure --prefix setting, and getting that wrong can lead to serious "gotchas".