[Ironruby-core] Library path in order to use gems

Tomas Matousek Tomas.Matousek at microsoft.com
Fri Jul 9 12:44:10 EDT 2010

If you first require 'rubygems' you shouldn't need to set any paths. 


-----Original Message-----
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Aaron Clauson
Sent: Friday, July 09, 2010 5:47 AM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] Library path in order to use gems


I'd like my C# hosted IronRuby script to be able to use gems (I install them with igem so they go into the IronRuby directory). I've been able to successfully require an installed gem but to do so I had to explicitly add the path it was installed in to the app.config LibraryPaths setting. If I have to do that for every gem it's going to end up being a very long parameter.

Is there a library path I can specify so that IronRuby will search beneath it to when doing requires?

My code looks like:

 var setup = ScriptRuntimeSetup.ReadConfiguration();
 var scriptRuntime = Ruby.CreateRuntime(setup);  ScriptEngine scriptEngine = Ruby.GetEngine(scriptRuntime);

 string script =
   "require 'httpclient'\n" +
    "print 'hello\n'";


The require works with a LibraryPath setting of:

        <set language='Ruby' option='LibraryPaths'

I would have thought instead of
I would specify
C:\Data\Dev\IronRuby\ironruby-1.0v4\lib\ironruby\gems\1.8\gems and sub directories would be automatically searched?

Posted via http://www.ruby-forum.com/.
Ironruby-core mailing list
Ironruby-core at rubyforge.org

More information about the Ironruby-core mailing list