# Requiring standard libraries within hosted DLR Runtime

**URL:** <https://www.ruby-forum.com/t/requiring-standard-libraries-within-hosted-dlr-runtime/166195>\
**Category:** IronRuby\
**Created:** [April 22, 2009, 5:59pm UTC](https://www.ruby-forum.com/t/requiring-standard-libraries-within-hosted-dlr-runtime/166195 "2009-04-22T17:59:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dotty](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e56c9b/32.png) [@dotty](https://www.ruby-forum.com/u/dotty)\
**Post date:** [April 22, 2009, 5:59pm UTC](https://www.ruby-forum.com/t/requiring-standard-libraries-within-hosted-dlr-runtime/166195/1 "2009-04-22T17:59:28Z")

</div>

Hello,

I previously tried sending this to the mailing list (on 04/17), but it  
doesn’t appear to have arrived there.

I did a git pull today (04/22/09), and rake compile, so I am using the  
very latest sources…  
I’m trying to attempt something simple but I can’t seem to get the  
hosted environment do to what I’m expecting.  
I’m trying to require any of the standard libraries (socket, digest,  
bigdecimal, etc.) from within the hosted runtime.  
Within my C# app:

var engine = IronRuby.Ruby.CreateEngine();  
engine.Execute(“puts ‘A’”);  
engine.Execute(“require ‘socket’”);

So the “A” prints as expected, but I get an  
“IronRuby.Builtins.LoadError” when I am at the require.  
The error message is: {“no such file to load – socket”}

Do I need to do something special to get at the libraries within  
IronRuby.Libraries?  
require ‘socket’ does work just fine when running from the ir.exe  
console…

I’ve attached the program.cs and the  
details of the stack trace to this forum post as a zip.

Thanks,  
Kevin R.

---

<div class="post-metadata">

**Author:** ![dotty](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e56c9b/32.png) [@dotty](https://www.ruby-forum.com/u/dotty)\
**Post date:** [April 22, 2009, 7:00pm UTC](https://www.ruby-forum.com/t/requiring-standard-libraries-within-hosted-dlr-runtime/166195/2 "2009-04-22T19:00:37Z")

</div>

Do you have the right library paths set?

engine.Execute(“puts $:”);

If not, you can either set them in App.config of your app (see  
ir.exe.config) or explicitly using engine.SetSearchPaths().

Tomas

---

<div class="post-metadata">

**Author:** ![dotty](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e56c9b/32.png) [@dotty](https://www.ruby-forum.com/u/dotty)\
**Post date:** [April 22, 2009, 7:28pm UTC](https://www.ruby-forum.com/t/requiring-standard-libraries-within-hosted-dlr-runtime/166195/3 "2009-04-22T19:28:11Z")

</div>

Hi Kevin,  
Let’s assume you have ironruby at c:\ironruby . add App.config from

> <https://gist.github.com/Jirapong/99910>

to your project.

Hope this helps,  
-Jirapong

---

<div class="post-metadata">

**Author:** ![dotty](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e56c9b/32.png) [@dotty](https://www.ruby-forum.com/u/dotty)\
**Post date:** [April 22, 2009, 8:27pm UTC](https://www.ruby-forum.com/t/requiring-standard-libraries-within-hosted-dlr-runtime/166195/4 "2009-04-22T20:27:25Z")

</div>

Jirapong Nanta wrote:

> Hi Kevin,  
> Let’s assume you have ironruby at c:\ironruby . add App.config from  
> [App.config · GitHub](http://gist.github.com/99910)  
> to your project.
> 
> Hope this helps,  
> -Jirapong

Jirapong, Tomas, It looks like that was it. I needed my searchpaths to  
be set. I didn’t realize they needed to be set. Looking at it now, it  
makes sense.

Thanks,  
Kevin R.
