This week the IronRuby team moved their source repository over to GitHub, with the layout now reflecting the structure they maintain internally. I just wanted to cover how I downloaded and built IronRuby on a Windows Vista machine – LinuxMac users will need to build via Mono. The first task is to download the code, as such you will need a git client, at the moment the best client I have found is msysgit.
msysgit installs both a GUI and command line, to download the source code I simply used the command line. Executing the following command within the directory where you want the code to be stored, for me this was E:IronRubyGit.
git clone git://github.com/ironruby/ironruby.git
The next task is to build the project, if you have MRI (Matz’s ruby) you can use the rake compile command, this will compile everything for you. If you don’t have MRI installed, you can build the Ruby.sln file using Visual Studio 2008 or the C# compiler (csc).
No such file or directory – e:ironrubygitironrubymerlinmainlanguagesrubysrcmicrosoft.scripting.core
(See full trace by running task with –trace)
However, I was greeted with a error message saying it was unable to find a file or directory. Luckily, the IronRuby mailing list is a great resource, and it turns out I needed to set the MERLIN_ROOT environment variable.
As a side note, merlin was the original codename for the IronPython team, which now includes IronRuby and the DLR (see John Lam’s post)
After solving this, I hit another error regarding tf.exe, the Team Foundation Source Control command line, being missing.
Cannot find tf.exe on system path.
The build script (rake) does a check to see if everything is configured correctly for IronRuby development, however tf isn’t required for building and actually only required internally within the team. The check for tf.exe is made within E:IronRubyGitironrubymerlinmainLanguagesRubyrakemisc.rake, search for the string and simply remove it from the array.
commands += [‘tf.exe’, ‘svn.exe’] if IronRuby.is_merlin?
Run rake compile again and IronRuby should happily build with the assemblies being built to ‘E:IronRubyGitironrubymerlinmainbindebug’
However, after launching ir.exe (the IronRuby REPL), I was unable to reference rubygems. After a bit of investigating, turns out the $LOAD_PATHS where incorrect. These paths are set within ir.exe.config, all you need to do is replace the following part of the path ExternalLanguagesRubyRuby-1.8.6libruby with => externallanguagesrubyredist-libsruby . It’s used three times, after replacing the values I could happily use IronRuby.
Hope this helps!