Install Ruby for Windows

Written on August 01, 2013

Ruby is a dynamic, open source programming language with a focus on simplicity and productivity and probably best known for its excellent web application framework Ruby on Rails.

If you’re a web developer who’s always been curious about Ruby and RoR but didn’t know where to start (especially because you have a Windows background) this hopefully gets you started.

Head over to RubyInstaller for Windows and download the installer Ruby 1.9.3-p448. Choose a folder to install (for me that’s D:\App\Ruby), check all boxes and install it.

To check if Ruby installed correctly, open the Run dialog box (Windows Key + R) and type powershell. In the PowerShell window type in the command ruby -v. If everything went well you should see a message like ruby 1.9.3p448 (2013-06-27) [i386-mingw32].

PS > ruby -v
ruby 1.9.3p448 (2013-06-27) [i386-mingw32]

Next install the Development Kit. Download the right DevKit for your version of Ruby. For version 1.9.3-p448 that’s tdm-32-4.5.2. Extract it to a folder of your choice (e.g. D:\App\DevKit) and change to that directory cd D:\App\DevKit.

Run the installation scripts by typing the command ruby dk.rb init to generate the config.yml. After that run the command ruby dk.rb install to bind the DevKit to your Ruby installation.

PS > cd D:\App\DevKit
PS D:\App\DevKit> ruby dk.rb init
PS D:\App\DevKit> ruby dk.rb install

Finally check that your Ruby environment is using the DevKit correctly by running gem install json --platform=ruby. This command will install the RubyGems library JSON, or gem like the Ruby folks call it.

If you have a .NET background think about RubyGems as something similar to NuGet, or Maven for the Java fanboy.

After JSON installed correctly run ruby -rubygems -e "require 'json'; puts JSON.load('[42]').inspect" to confirm that the JSON gem is working. This should show you the answer to life, the universe, and everything.

PS > gem install json --platform=ruby
PS > ruby -rubygems -e "require 'json'; puts JSON.load('[42]').inspect"
PS > [42]

Martin Buberl

Purveyor of Internet duct tape.
If you'd like to get in touch, feel free to shout @martinbuberl.