Latest web development tutorials

Ruby installation - Linux

Here are the steps to install Ruby on a Linux machine.

Note: Before installation, make sure that you have root privileges.


Source Installation

  • Download the latest version of Ruby compressed files. Click here to download .
  • After downloading Ruby, unzip to the newly created directory:
$ tar -xvzf ruby-2.2.3.tgz    
$ cd ruby-2.2.3
  • Now, configure and compile the source code as follows:
$ ./configure
$ make
$ sudo make install
  • After installation, by entering the following at the command line to make sure everything is working properly:
$ruby -v
ruby 2.2.3……
  • If everything is working properly, Ruby interpreter will output the installed version, shown above. Other versions If you installed, other different versions will be displayed.

Automatically install Ruby

If your computer is already connected to the Internet, then the easiest way is to install Ruby usingyum or apt-get.Enter the following command at a command prompt, you can install Ruby on your computer.

$  sudo yum install ruby    # CentOS, Fedora, 或 RHEL 系统

或

sudo apt-get install ruby-full # Debian 或 Ubuntu 系统

If you are the Apple system, you can use the command to install brew:

$ brew install ruby