# Building IronRuby under Mono

**URL:** <https://www.ruby-forum.com/t/building-ironruby-under-mono/155038>\
**Category:** IronRuby\
**Created:** [December 6, 2008, 7:45pm UTC](https://www.ruby-forum.com/t/building-ironruby-under-mono/155038 "2008-12-06T19:45:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![visitor1981](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/74df32/32.png) [@visitor1981](https://www.ruby-forum.com/u/visitor1981)\
**Post date:** [December 6, 2008, 7:45pm UTC](https://www.ruby-forum.com/t/building-ironruby-under-mono/155038/1 "2008-12-06T19:45:24Z")

</div>

Hello,

I’m trying to compile IronRuby under Mono, but I’m receiving a few  
errors.  
Any ideas?

$ uname -a  
Linux zen 2.6.27-9-generic #1 SMP Thu Nov 20 22:15:32 UTC 2008 x86\_64  
GNU/Linux

$ mono --version  
Mono JIT compiler version 1.9.1 (tarball)  
Copyright (C) 2002-2007 Novell, Inc and Contributors.  
[www.mono-project.com](http://www.mono-project.com)  
TLS: \_\_thread  
GC: Included Boehm (with typed GC)  
SIGSEGV: altstack  
Notifications: epoll  
Architecture: amd64  
Disabled: none

$ gmcs --version  
Mono C# compiler version 1.9.1.0

$ svn co -r 144 [http://ironruby.rubyforge.org/svn/trunk](http://ironruby.rubyforge.org/svn/trunk) ironruby  
$ cd ironruby/  
$ wget  
[http://sparcs.kaist.ac.kr/~tinuviel/download/IronRuby/patch-mono-r144](http://sparcs.kaist.ac.kr/~tinuviel/download/IronRuby/patch-mono-r144)  
$ patch -p0 \< patch-mono-r144

$ rake compile mono=1  
(in /home/antonio/code/ruby/ironruby)  
./ast/MethodCallExpression.cs(167,18): warning CS0219: The variable  
`invoke' is assigned but its value is never used ./ast/expressiontreevisitor.cs(99,30): warning CS0219: The variable `c’  
is  
assigned but its value is never used  
./actions/callsite.cs(255,25): warning CS0219: The variable `newRule' is assigned but its value is never used ./actions/callsite.cs(146,18): warning CS0219: The variable `typeofT’ is  
assigned but its value is never used  
./com/VarEnumSelector.cs(313,37): warning CS0168: The variable  
`narrowingLevel' is declared but never used ./compiler/LambdaCompiler.Logical.cs(182,33): warning CS0219: The variable `p’ is assigned but its value is never used  
./compiler/LambdaCompiler.Logical.cs(234,19): warning CS0219: The  
variable  
`labReturnLeft' is assigned but its value is never used ./compiler/LambdaCompiler.Logical.cs(410,19): warning CS0219: The variable `labReturnLeft’ is assigned but its value is never used  
./compiler/LambdaCompiler.Statements.cs(368,19): warning CS0219: The  
variable `endCatchBlock' is assigned but its value is never used ./compiler/lambdacompiler.unary.cs(84,35): warning CS0219: The variable `labIfNull’ is assigned but its value is never used  
./compiler/TryStatementInfo.cs(110,24): warning CS0219: The variable  
`cb' is assigned but its value is never used ./compiler/ilgen.cs(1104,18): warning CS0219: The variable `isFromFloatingPoint’ is assigned but its value is never used  
./utils/helpers.cs(37,20): error CS1502: The best overloaded method  
match  
for `System.Reflection.Emit.DynamicMethod.DynamicMethod(string, System.Type, System.Type[], System.Reflection.Module)' has some invalid arguments /usr/lib/mono/2.0/mscorlib.dll (Location of the symbol related to previous error) ./utils/helpers.cs(37,20): error CS1503: Argument 4: Cannot convert type `bool’ to `System.Reflection.Module’  
Compilation failed: 2 error(s), 12 warnings  
rake aborted!  
Command failed with status (1): [gmcs  
/out:"/home/antonio/code/ruby/ironrub…]  
/home/antonio/code/ruby/ironruby/Rakefile:270  
(See full trace by running task with --trace)

Thanks in advance,  
Antonio

---

<div class="post-metadata">

**Author:** ![visitor1981](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/74df32/32.png) [@visitor1981](https://www.ruby-forum.com/u/visitor1981)\
**Post date:** [December 6, 2008, 8:04pm UTC](https://www.ruby-forum.com/t/building-ironruby-under-mono/155038/2 "2008-12-06T20:04:19Z")

</div>

2008/12/7 Antonio C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Mono JIT compiler version 1.9.1 (tarball)  
> Copyright (C) 2002-2007 Novell, Inc and Contributors. [www.mono-project.com](http://www.mono-project.com)  
> TLS: \_\_thread  
> GC: Included Boehm (with typed GC)  
> SIGSEGV: altstack  
> Notifications: epoll  
> Architecture: amd64  
> Disabled: none

Try Mono 2.0?

---

<div class="post-metadata">

**Author:** ![visitor1981](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/74df32/32.png) [@visitor1981](https://www.ruby-forum.com/u/visitor1981)\
**Post date:** [December 6, 2008, 9:52pm UTC](https://www.ruby-forum.com/t/building-ironruby-under-mono/155038/3 "2008-12-06T21:52:07Z")

</div>

Using Mono 2.0 I was able to build IronRuby but it’s not working  
properly:

~/code/ruby/ironruby/build/mono\_debug$ ./ir.exe  
IronRuby 1.0.0.0 on .NET 2.0.50727.42  
Copyright © Microsoft Corporation. All rights reserved.

Note that local variables do not work today in the console.  
As a workaround, use globals instead (eg $x = 42 instead of x = 42).

> > > 3 + 3  
> > > unknown: An exception was thrown by the type initializer for  
> > > Microsoft.Scripting.SourceCodeReader  
> > > (System::TypeInitializationException)

~/code/ruby/ironruby/build/mono\_debug$ mono ./ir.exe  
~/code/ruby/hello.rb  
mscorlib:0:in `set_Fallback': Argument cannot be null. (System::ArgumentNullException) from mscorlib:0:in`.ctor’  
from mscorlib:0:in `GetDecoder' from mscorlib:0:in`Initialize’  
from mscorlib:0:in `.ctor' from mscorlib:0:in`.ctor’

Any suggestions?

Thanks,  
Antonio

---

<div class="post-metadata">

**Author:** ![visitor1981](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/74df32/32.png) [@visitor1981](https://www.ruby-forum.com/u/visitor1981)\
**Post date:** [December 8, 2008, 12:18am UTC](https://www.ruby-forum.com/t/building-ironruby-under-mono/155038/4 "2008-12-08T00:18:41Z")

</div>

I’m curious… I’m running into a number of issues just compiling… is  
this  
from the SVN or Git repo?

---

<div class="post-metadata">

**Author:** ![visitor1981](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/74df32/32.png) [@visitor1981](https://www.ruby-forum.com/u/visitor1981)\
**Post date:** [December 8, 2008, 12:49am UTC](https://www.ruby-forum.com/t/building-ironruby-under-mono/155038/5 "2008-12-08T00:49:06Z")

</div>

2008/12/8 Michael L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> I’m curious… I’m running into a number of issues just compiling… is this  
> from the SVN or Git repo?

He is using old SVN version. The latest doesn’t compile for me.
