How to build latest Ruby on Windows
So you want to build the latest Ruby on Windows. Maybe, you’re working on some new RubySpec tests or would like to see what’s coming with Ruby 1.9.2. At any rate, building Ruby on Windows is much easier than I originally thought, and you don’t even forced to install Microsoft compilers at all! Good folks over RubyInstaller project made all the hard work for you already, setting up the environment to build with MinGW compiler. So, the receipt is as follows:
- Clone the RubyInstaller repository: git clone git://github.com/oneclick/rubyinstaller.git
- In that cloned directory, invoke: rake ruby19 CHECKOUT=1 TRUNK=1
And you’re done! That rake command will fetch the MinGW compiler all the required libraries, it will checkout the latest Ruby source from the subversion repository, then it will configure and build it.
Minimal requirements for you system before you start: Subversion, Ruby 1.8.6 installed and somewhere on your PATH. I recommend the one from RubyInstaller (tested with 1.8.6 p383). That’s about it. The Ruby from RubyInstaller comes with rubygems preinstalled, so obtaining the Rake is as trivial as: gem install rake.
Entire setup would take you a couple of minutes. Then, the build… That would take longer, expect it to run for at least 20-30 minutes. And this is not as fast as 30 seconds recompile of entire JRuby tree.
P.S. Big thanks to Luis Lavena for helping out with the debugging the build failures and reporting them to Ruby-core so that they are all now fixed.