Ruby Installation-Linux
The following is a list of steps to install Ruby on a Linux machine.
Note: Before installing, make sure you have root permissions.
SOURCE Installation
Download the latest version of the Ruby zip file. Please click here to download.
After you download 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, make sure everything works by entering the following command at the command line:
If all works correctly, the version of the installed Ruby interpreter will be output, as shown above. If you have another version installed, a different version is displayed.
Automatically install Ruby
If your computer is already connected to the Internet, the easiest way to install Ruby is to use Yum or apt-get. You can install Ruby on your computer by entering the following command at the command prompt.
$ 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:
Ruby Installation-Windows
The following is a list of steps to install Ruby on a Windows machine.
Note: When installing, you may have different versions available.
- Window system, we can use Rubyinstaller to install Ruby environment, download the address: please click here to download.
- After downloading the Rubyinstaller, unzip to the newly created directory:
- Double-click the Rubyinstaller-2.2.3.exe file to start the Ruby Setup Wizard.
- Click Next to continue with the wizard, and remember to check ADD Ruby executables to your PATH until Ruby Setup completes Ruby Setup.
If your installation does not properly configure environment variables, then you may need to configure the environment variables.
- If you are using Windows 9x, add in your c:\autoexec.bat: Set path= d:\ (Ruby installation directory) \bin;%path%
- Windows nt/2000 users need to modify the registry.
- Click on Control Panel | system Performance | environment variable.
- Under the system variable, select Path and click EDIT.
- Add a Ruby directory at the end of the list of variable values and click OK.
- Under the system variable, select Pathext and click EDIT.
- Add to. RB and. RBW to the list of variable values and click OK.
After installation, make sure everything works by entering the following command at the command line:
If all works correctly, the version of the installed Ruby interpreter will be output, as shown above. If you have another version installed, a different version is displayed.