Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Ruby Installation - Unix


May 12, 2021 Ruby


Table of contents


Ruby Installation - Unix

The steps for installing Ruby on unix machines are listed below.

Note: Before you install, make sure that you have root permissions.

  • Download the latest version of ruby compressed files. Click here to download .
  • After downloading Ruby, unziw 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
    • Once installed, make sure everything works by entering the following commands on the command line:
    $ruby -v
    ruby 2.2.3……
  • If all works, the installed version of the Ruby interpreter will be output, as shown above. If you have a different version installed, a different version is displayed.
  • Install Ruby automatically

    If your computer is connected to the Internet, the easiest way to install Ruby is to use yum or apt-get. Enter the following command in the command prompt to install Ruby on your computer.

    $  sudo yum install ruby    # CentOS, Fedora, 或 RHEL 系统
    
    或
    
    sudo apt-get install ruby-full # Debian 或 Ubuntu 系统
    

    If you are an Apple system, you can install it using the brew command:

    $ brew install ruby