Last modified: Sat May 19 2018 18:00:53 GMT+0800 (Malay Peninsula Standard Time)

Chapter 5. Windows Installation Guide for Ruby 2.5.x

The following guide in this chapter was tested on machines running

  • Windows 7 Professional 64-bit
  • Windows 8.1 Professional 64-bit

5.1 Obtaining Required Files

If you already have a copy of Ruby and Rails installed on your machine that is not installed based on this tutorial, it is recommended to remove them from your machine and follow the instruction in this tutorial. You may have multiple copies of Ruby version in your machine.

To begin, determine your Windows Architecture and obtain the URL to the files from correct table below. If you are using Windows machine, it is recommended for you to use Ruby 2.2.3, 2.5.1, and 2.5.1 as they are the version that I personally tested. Any other Ruby version between 2.2.3 and 2.5.1 tend to have issue with Windows machine.

Table 5.1.1: Required files for 32-bits Operating System

File File Name
Ruby 2.5.1-1 Installer rubyinstaller-2.5.1-1-x86.exe
Node.JS node-v8.11.2-x86.msi

Table 5.1.2: Required files for 64-bits Operating System

File File Name
Ruby 2.5.1-1 Installer rubyinstaller-2.5.1-1-x64.exe
Node.JS node-v8.11.2-x64.msi

5.2 Ruby Installation

Run the Ruby Installer and the screen as shown in Figure 5.2.1 will should show up. Accept the license agreement and proceed to the next step by pressing the “Next” button.


Figure 5.2.1: Ruby 2.5.1 License Agreement

Check “Add Ruby executables to your PATH” and complete the installation by pressing the “Install” button as shown in Figure 5.2.2.


Figure 5.2.2: Ruby 2.5.1 Installation Destination and Optional Tasks

Before the installation begin, as shown in Figure 5.2.3, you will ask if you would like to have MSYS2 install. Make sure the option is checked and press "Next" to continue the installation. The installation will then begin.


Figure 5.2.3: MSYS2 installation option

After the installation is completed, a window shown in Figure 5.2.4 will show up. Make sure that the check box is checked and press finish to complete the installation.

Figure 5.2.4: MSYS2 installation option

5.3 MSYS2 Installation and Setup

After the Ruby installation is completed, a terminal window, as shown in Figure 5.3.1, will pop up.


Figure 5.3.1: MSYS2 Installation Window

All the components 1, 2, and 3 are required to be installed. To begin, insert 1, 2, 3 into the terminal. Figure 5.3.2 shows the required files are being downloaded.

_Not: Figure 5.3.2 shows only 1 is inserted into the next box. You should insert 1, 2, 3.


Figure 5.3.2: MSYS2 required files are being downloaded.

The installation may take a while depending on your computer processing speed and internet connection. Figure 5.3.3 shows the installation has been successfully completed.


Figure 5.3.3: MSYS2 setup completed

5.4 Node.JS Installation

Run the Ruby Installer and the following screen shown in Figure 5.4.1 will show up.


Figure 5.4.1: Node.js Setup Wizard

Accept the license agreement as shown in Figure 5.5.2 and proceed to the next step by pressing the “Next” button.


Figure 5.5.2: Node.js License Agreement Screen

Complete the installation by going through each steps.

5.5 Change RubyGems’ Source

To avoid receiving SSL error when trying to install Rails or pull updates from RubyGems, open a command line window and enter the following commands below.

gem sources -r https://rubygems.org/

gem sources -a http://rubygems.org/

A similar output as shown in Figure 5.5.1 will be generated from the command line tool after you inputted the second command. Figure 5.5.1 shows the second command only. Please run both of the commands.

Input the character y to the command line tool to add http://rubygems.org/ to sources.


Figure 5.5.1: Output of terminal

5.6 Rails Installation

Open a command line window and insert the following command below. The command below will install the latest version of Rails.

gem install rails

A similar output as shown in Figure 5.6.1 will be generated from the command line tool.


Figure 5.6.1: Output of terminal while installing Rails

To verify that you have successfully installed both Ruby and Rails, enter the following command. A similar output as shown in Figure 5.6.2 will be generated from the command line tool.

Ruby –v

Rails -v


Figure 5.6.2: Ruby and Rails successfully installed.

5.7 Create a Rails Application

The steps are identical compared to Ruby V2.4.1. Please refer to this section.

5.8 Start your server

The steps are identical compared to Ruby V2.4.1. Please refer to this section.

5.9 Generate a simple MVC

The steps are identical compared to Ruby V2.4.1. Please refer to this section.

results matching ""

    No results matching ""