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!
3 thoughts on “Downloading IronRuby from GitHub”
Thanks tons for the rubygems fix, it would have taken me hours to figure that out. RULE!
I get this error from GIT:
C:IronRubyGit>git clone git://github.com/ironruby/ironruby.git
Initialized empty Git repository in C:/IronRubyGit/ironruby/.git/
github.com[0: 126.96.36.199]: errno=Invalid argument
fatal: unable to connect a socket (Invalid argument)
Hi again Colin. If you just want to run ir.exe on Windows. why don’t you try the easier way as i do my blog posted at http://www.bananacoding.com/oxite.aspx/Blog/buildironruby