2012-01-05

Install IronRuby for MonoDevelop / C# under Linux

A tutorial on how to prepare your .NET4 environment for ruby scripts under Linux / Ubuntu.

Gainet a lot of information from this tutorial: http://zuulcat.com/2011/06/06/installing-ironruby-from-source-on-mono/

Installing ruby runtime
*) If you have Ruby binaries installed you can skip this step (the latest source can be found at http://www.ruby-lang.org/en/downloads/ )
*) Download the latest source (currently, 1.9.3)
$ wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz
$ tar xvf ruby-1.9.3-p0.tar.gz
$ cd ruby-1.9.3-p0/
$ ./configure --prefix=/usr
$ make
$ sudo make install

*) Install xbuild
$ sudo apt-get install mono-xbuild

*) Make sure you are running the latest .NET 4.0 framework (see my previous post)
You need mono 2.10.x. In order to check your version type
$ dmcs --version
$ xbuild /version

*) Download and install the IronRuby runtime libraries.
$ git clone git://github.com/IronLanguages/main.git src

*) Build the solutions needed
$ cd src
$ xbuild /p:Configuration=Debug Solutions/Ruby.sln

*) Add the libraries to the assembly cache. Make sure the files are added to the right directory. You can specify it by using the -root parameter (ie: gacutil -root /usr/lib -i library.dll if your gac path is /usr/lib/mono/gac).
$ cd bin/Debug
$ sudo gacutil -i IronRuby.dll
$ sudo gacutil -i Microsoft.Scripting.dll
$ sudo gacutil -i Microsoft.Dynamic.dll
$ sudo gacutil -i IronRuby.Libraries.dll

*) Gathering and installing binary and source files

$ sudo mkdir -p /usr/local/ironruby/bin
$ sudo cp * /usr/local/ironruby/bin
$ sudo mkdir /usr/local/ironruby/lib
$ sudo cp -R ../../Languages/Ruby/StdLib/* /usr/local/ironruby/lib
$ sudo cp -R !(*.bat) ../../Languages/Ruby/Scripts/bin/ /usr/local/ironruby/bin

I WILL add an example of a ironruby project here. later.

No comments:

Post a Comment