Tutorial on installing the Ruby interpreter on the operating system.

Source: Internet
Author: User

Tutorial on installing the Ruby interpreter on the operating system.

Ruby installation-Linux
The steps for installing Ruby on a Linux machine are listed below.
Note: before installation, make sure that you have the root permission.
Source code Installation
Download the latest Ruby compressed file. Click here to download.
After downloading Ruby, decompress it 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, enter the following command in the command line to ensure that everything works properly:

$ruby -vruby 2.2.3……


If everything works properly, the version of the installed Ruby interpreter will be output, as shown above. If you have installed other versions, different versions are displayed.
Automatically install Ruby
If your computer has been connected to the Internet, the simplest 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, or RHEL System

Or

Sudo apt-get install ruby-full # Debian or Ubuntu System


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

$ brew install ruby

Ruby installation-Windows
The steps for installing Ruby on a Windows machine are listed below.
Note: You may have different available versions during installation.

  • In the Windows system, we can use RubyInstaller to install the Ruby environment. For details, click here to download.
  • After downloading rubyinstaller, decompress it to the newly created directory:
  • Double-click the rubyinstaller-2.2.3.exe file to start the Ruby Installation Wizard.
  • Click Next to continue the Wizard. Remember to check Add Ruby executables to your PATH until the Ruby installer completes Ruby installation.

If your installation does not properly configure the environment variables, you may need to configure the environment variables.

  • If you are using Windows 9x, go to your c: \ autoexec. add: set PATH = "D: \ (ruby installation directory) \ bin; % PATH %" to bat"
  • For Windows NT/2000, you need to modify the registry.
  • Click Control Panel | System Performance | environment variable.
  • Under system variables, select Path and click EDIT.
  • Add the Ruby directory at the end of the variable value list and click OK.
  • Under system variables, select PATHEXT and click EDIT.
  • Add. RB and. RBW to the variable value list, and click OK.

After installation, enter the following command in the command line to ensure that everything works properly:

$ruby -vruby 2.2.3


If everything works properly, the version of the installed Ruby interpreter will be output, as shown above. If you have installed other versions, different versions are displayed.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.