If you are still willing to set up your environment for Ruby programming language, then let's proceed. This tutorial will teach you all the important topics related to environment setup. We would recommend you to go through the following topics first and then proceed further −
1. Ruby Installation - Unix :
Here are the steps to be followed to install Ruby on a Unix machine −
NOTE − Before proceeding, make sure you have root privilege.
- Download a zipped file having the latest version of Ruby from https://www.ruby-lang.org/en/downloads/.
- After having downloaded the Ruby archive, unpack it and change into the newly created directory-
$ tar -xvzf ruby-1.6.7.tgz
$ cd ruby-1.6.7
- Now, configure and compile the source code as follows −
$ ./configure
$ make
-Finally, install Ruby interpreter as follows −
$ su -l root # become a root user
$ make install
$ exit # become the original user again
- After installation, make sure everything is working fine by issuing the following command on the command-line −
$ruby -v
ruby 1.6.7 (2002-06-04) [i386-netbsd]
Using yum to Install Ruby
If your computer is connected to the Internet, then the easiest way to install Ruby or any other RPM is using the yum utility. Give the following command at the command prompt and you will find Ruby gets installed on your computer.
$ yum install ruby