Downloading IronRuby from GitHub

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).

E:IronRubyGitironrubymerlinmainLanguagesRuby>rake compile
(in E:/IronRubyGit/ironruby/merlin/main/Languages/Ruby)
——————————————————————————-
dlr_core
——————————————————————————-
rake aborted!
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.

E:IronRubyGitironrubymerlinmainLanguagesRuby>set MERLIN_ROOT=e:ironrubygitironrubymerlinmain

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!

Technorati Tags: , ,

3 thoughts on “Downloading IronRuby from GitHub”

  1. 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: 65.74.177.129]: errno=Invalid argument
    fatal: unable to connect a socket (Invalid argument)

    Any ideas?

Leave a Reply

Your email address will not be published. Required fields are marked *