As Tinkster said ruby generally comes pre-compiled (i.e. as binaries) for most linux distros so you don't have to compile it. In general, compiling is quite easy (even I can do it
). So here's a quick howto.
1. Download the source code. This typically comes as a "tarball" (a compressed file with the extension -----.tar.gz
2. Open a terminal and navigate to the folder where you downloaded the tarball.
3. At the terminal prompt type:
tar zxvf [name of tarball]
You will see a large number (usually) of files being uncompressed to a new folder where all the source code is found.
4. cd to the newly created folder (its name appears at the beginning of every file extracted from the tarball).
5. Now that you're in the new folder, type
at the command prompt. You should see a file called "configure". (If there is no "configure" file go to step 7.)
6. Now type
7. Assuming you get no errors, now type
8. Now become root (type "su" and then the root password or type "sudo" and you will be prompted for your own password if sudo has been set up) and type
That's it. If there are no errors your executables are usually installed in /usr/local/bin
Occasionally the tarball ends in bz2 instead of gz. Just change the command given in step 3 to
tar jxvf [name of tarball]
Everything else is the same.
This is not the only method for compiling but just the one that you will come across most frequently.