18 March 2017

Here’s a small cheat sheet for installing both the Ruby runtime, and the Ruby compiler and SDK that you can use for developing gems, and compiling gems from source, which is necessary from time to time.

Installing Ruby

First go to RubyInstaller.org and download the package Ruby 2.3.3 (x64) and install it. I recommend installing in the root of your OS drive, so C:\Ruby23-x64, check the box Add Ruby executables to your PATH, this option should make life easier later on, for instance if you want to build from CMD, or from Git BASH as I do.

Second, download the package DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe, and unpack it to C:\RubyDev.

Configuring Ruby - part one

Go to C:\RubyDev\postinstall and run the script pi.bat.

When prompted Do you wish to continue with the post install? Type y, and hit Enter.

When prompted Do you have MinGW installed? Type n, and hit Enter.

A tip will come up suggesting that if you install MinGW, install it to a specific path, this is not relevant right now, so just hit Enter.

If prompted for a conflict in MinGW version, just ignore this and hit Enter again.

Now this process is over, just hit Enter again, and the script will exit.

Configuring Ruby - part two

Start the newly installed MinGW, or any previously installed MinGW prompts, and cd to /C/RubyDev.

Run command ruby dk.rb init.

Open the file C:\RubyDev\config.yml in a text editor, and make the content like below.

# This configuration file contains the absolute path locations of all

# installed Rubies to be enhanced to work with the DevKit. This config

# file is generated by the 'ruby dk.rb init' step and may be modified

# before running the 'ruby dk.rb install' step. To include any installed

# Rubies that were not automagically discovered, simply add a line below

# the triple hyphens with the absolute path to the Ruby root directory.

#

# Example:

#

# ---

# - C:/ruby19trunk

# - C:/ruby192dev

#

---
- C:/Ruby23-x64

Finally, run the command ruby dk.rb install. If you get a warning about skipping, because you have a previous or misconfigured installtion, run the command ruby dk.rb install --force instead.

Now you’re done, and should be ready for installing and developing (with) Ruby gems :-)