# Help setting up environment on Mono 2.10.2 OS X 10.7

**URL:** <https://www.ruby-forum.com/t/help-setting-up-environment-on-mono-2-10-2-os-x-10-7/212921>\
**Category:** IronRuby\
**Created:** [October 18, 2011, 1:11am UTC](https://www.ruby-forum.com/t/help-setting-up-environment-on-mono-2-10-2-os-x-10-7/212921 "2011-10-18T01:11:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [October 18, 2011, 1:11am UTC](https://www.ruby-forum.com/t/help-setting-up-environment-on-mono-2-10-2-os-x-10-7/212921/1 "2011-10-18T01:11:19Z")

</div>

Goal: Equip my C# project with a sane, useful IronRuby testing  
environment  
that is consistent across OS X and Windows. To that end, I hope to use  
RVM,  
Bundler (with binstubs), Rake, RR, and RSpec.

Background:  
Per [Redirecting…](http://www.mono-project.com/Release_Notes_Mono_2.10#Languages:)  
“Starting with Mono 2.10, we are bundling the open source F# compilers  
and  
tools, and the IronRuby [http://ironruby.net/](http://ironruby.net/) and  
IronPython[http://ironpython.net/](http://ironpython.net/) systems  
in our Linux packages as well as in our Mac installer.”  
So, my /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/  
contains: bin with all /compiled/ IronRuby assemblies and configs (not  
including important stuff like gem, etc.), and Lib with a regular ol  
Ruby  
standard library with IronRuby goodies mixed in.

Problems:

- RVM doesn’t support IronRuby at all, and all patches or forks that I  
found  
have gone stale.
- requirement.rb patch is necessary to even begin using rubygems:  
[Require 'rubygems' gives llformed requirement ["\>= 0"] (ArgumentError) - IronRuby - Ruby-Forum](http://www.ruby-forum.com/topic/1864531)
- Mono’s IronRuby distribution doesn’t include gem/igem, so I ganked it  
from  
the Github repo @v1.1.3, but executing something like “ir  
IronLanguages/Languages/Ruby/Scripts/bin/gem install bundler  
–backtrace”  
produces this output:  
ERROR: Loading command: install (IndexError)  
Array index is out of range.  
mscorlib:0:in `GetChars' mscorlib:0:in `GetChars’  
mscorlib:0:in `GetChars' mscorlib:0:in `ReadBuffer’  
mscorlib:0:in `Read' /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/custom_require.rb:28:in `require’  
mscorlib:0:in `require' mscorlib:0:in `CallSite.Target’  
/Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/bin/…/Lib/ruby/1.9.1/rubygems/custom\_require.rb:28:in  
`require' /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/custom_require.rb:28:in `require’  
/Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/bin/…/Lib/ruby/1.9.1/rubygems/custom\_require.rb:28:in  
`require' /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/custom_require.rb:28:in `require’  
/Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/bin/…/Lib/ruby/1.9.1/rubygems/custom\_require.rb:28:in  
`require' /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/custom_require.rb:28:in `require’  
/Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/bin/…/Lib/ruby/1.9.1/rubygems/custom\_require.rb:28:in  
`require' /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/custom_require.rb:28:in `require’  
/Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/bin/…/Lib/ruby/1.9.1/rubygems/custom\_require.rb:28:in  
`require' mscorlib:0:in `require’  
mscorlib:0:in `invoke_object __this___ Func`5\<CallSite, RubyScope, object,  
object, object\>\_CallSite\_RubyScope\_object\_object’  
/Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/bin/…/Lib/ruby/1.9.1/rubygems/custom\_require.rb:28:in  
`require' ERROR: While executing gem ... (NameError) uninitialized constant Gem::Commands::InstallCommand /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/command_manager.rb:164:in `const\_missing’  
/Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/bin/…/Lib/ruby/1.9.1/rubygems/command\_manager.rb:164:in  
`load_and_instantiate' /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/command_manager.rb:90:in `[]’  
/Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/bin/…/Lib/ruby/1.9.1/rubygems/command\_manager.rb:146:in  
`find_command' /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/command_manager.rb:133:in `process\_args’  
/Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/bin/…/Lib/ruby/1.9.1/rubygems/command\_manager.rb:104:in  
`run’
- Using standard Ruby, I can “gem install bundler  
–install-dir  
/Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/Lib/ruby/gems/1.9.1”  
and  
“bundle install --binstubs”, but then running ir bin/rspec  
spec/pong\_spec.rb  
produces:  
mscorlib:0:in `invoke_object __this___ Func`4\<object, Proc, object,  
object\>\_object\_Proc\_object’: undefined method `realpath' for File:Class (NoMethodError) from /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/bin/../Lib/ruby/1.9.1/pathname.rb:446:in `realpath’

I can get around this by editing the binstubs to just use **FILE**  
instead  
of Pathname.new( **FILE** ).realpath, which gives me:

$  
GEM\_PATH=/Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/Lib/ruby/gems/1.9.1  
ir bin/rspec spec/pong\_spec.rb  
mscorlib:0:in `invoke_object __this___ Func`4\<object, Proc, object,  
object\>\_object\_Proc\_object’: can’t convert Pathname into String  
(TypeError)  
from  
/Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/Lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/settings.rb:5:in  
`initialize' from /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/Lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler.rb:185:in `settings’  
from  
/Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/Lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler.rb:261:in  
`configure_gem_home_and_path' from mscorlib:0:in `invoke\_object\_\_this\_\_\_Func`4<object, Proc, object, object>_object_Proc_object' from /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/Lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler.rb:82:in `configure’  
from  
/Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/Lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler.rb:136:in  
`definition' from mscorlib:0:in `invoke\_object\_\_this\_\_\_Func`4<object, Proc, object, object>_object_Proc_object' from /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/Lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler.rb:126:in `load’  
from  
/Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/Lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler.rb:110:in  
`setup' from /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/bin/../Lib/ruby/1.9.1/rubygems/custom_require.rb:28:in `require’  
from  
/Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/bin/…/Lib/ruby/1.9.1/rubygems/custom\_require.rb:28:in  
`require’  
from  
/Library/Frameworks/Mono.framework/Versions/2.10.2/lib/ironruby/Lib/ruby/gems/1.9.1/gems/bundler-1.0.21/lib/bundler/setup.rb:17

Current workarounds:  
Steal gem from IronLanguages, patch requirement.rb, don’t use RVM, don’t  
use  
Bundler, use standard Ruby to install gems to IronRuby’s gems dir.

Plea for help:  
The lack of RVM+Bundler support and all the manual mucking around is  
definitely sub-optimal; is anyone working on this problem, or does  
anyone  
have suggestions on where to start trying to fix it? I really want to  
show  
my OS X Ruby brethren all the cool stuff that’s possible with IronRuby,  
but  
there’s no way I can make them go through this.
