Skip to content

Building Ruby 2.1 x64 on Windows 8

Today I decided to play around with Ruby a bit again. The latest version being 2.1.2, official installers were only available up to 2.0. I know it’s only one minor version, but I don’t like using outdated versions. The warning about many packages not being compatible to Ruby 2.0 on Windows (especially the 64bit version) only worried me slightly. Unfortunately I’ve been used to some abuse from working in Python 3, where an awful lot of packages still is only compatible to Python 2.7. 

At any rate, compiling Ruby 2.1.2 on Windows 8 (x64) wasn’t as straightforward as one might think, but also not terribly complicated. This is what I did:

  1. Installed Visual Studio 2013 Ultimate & Windows 8.1 Platform SDK
  2. Downloaded & extracted Ruby 2.1.2 source tarball to some directory %SRC%
  3. Open Visual Studio Tools / VS2013 x64 Native Tools Command Prompt
  4. In %SRC% execute win32\configure –prefix “C:\Ruby”
  5. In %SRC% execute nmake – at this point the compilation process failed because the file “probes.h” could not be found. The file is located in the “win32” subfolder, and curiously simply copying it into the %SRC% folder fixed the problem and allowed the compilation process to finish.
  6. nmake test should pass all tests
  7. nmake install 

So the whole process was not the difficult once I figured out the details. At the beginning I also ran into problems when attempting to execute nmake from the win32 subfolder directly, which doesn’t work as pointed out at the bottom of the README file. ^_^

7 replies »

  1. Hmm, thanks for this. I managed to build (the process.h file has been put in the right place now it seems) but although I can use the IRB and ruby.exe programs, I get an error message when I run namke test. I don’t really understand so have posted a screenshot here in case you are anyone else knows what the problem might be:

    • I think you forgot to post the screenshot. But is it possible that you executed “nmake test” directly from the win32 subdirectory? If yes, try changing to the parent directory first.

      • Thanks for the swift reply. I did post the screenshot but perhaps it wasn’t accepted. I had a 64 encoded string in an image tag. Also, I ran nmake test in the root directory (the same directory where ruby.exe is located).

    • Sorry for the late reply this time. Unfortunately I have no idea what’s wrong in your case. The error message indicates that the file “thread” cannot be loaded. But I don’t know enough about Ruby to make anything of it, sorry.

  2. I believe the line ‘win32\configure –prefix “C:\Ruby”’ should be ‘win32\configure –-prefix “C:\Ruby”’. You’re missing a dash

  3. Hi,
    I’m trying to follow your tutorial and I’ve come up with the same error as Matthew.
    Did anyone find a way around it ?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s



%d bloggers like this: