# Erb

**URL:** <https://www.ruby-forum.com/t/erb/158977>\
**Category:** IronRuby\
**Created:** [January 29, 2009, 11:01pm UTC](https://www.ruby-forum.com/t/erb/158977 "2009-01-29T23:01:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pozza](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/8e8cbc/32.png) [@pozza](https://www.ruby-forum.com/u/pozza)\
**Post date:** [January 29, 2009, 11:01pm UTC](https://www.ruby-forum.com/t/erb/158977/1 "2009-01-29T23:01:23Z")

</div>

I playing with using ERB in IronRuby and having a little problem. The  
code below works fine with Ruby:

require ‘erb’  
puts ERB.new(‘hello world’).result

but in IronRuby I get this error:

IronRuby.Libraries:0:in `require’: no such file to load – erb  
(LoadError)  
from :0

Now if I change the require to this it works:

require ‘C:\ruby\lib\ruby\1.8\erb.rb’  
puts ERB.new(‘hello world’).result

I assume my IronRuby config is wrong but how do I fix it?

---

<div class="post-metadata">

**Author:** ![pozza](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/8e8cbc/32.png) [@pozza](https://www.ruby-forum.com/u/pozza)\
**Post date:** [January 30, 2009, 12:43am UTC](https://www.ruby-forum.com/t/erb/158977/2 "2009-01-30T00:43:42Z")

</div>

There should be a line in ir.exe.config that says something like:

```
  <set language="Ruby" option="LibraryPaths" 

```

value="…\Languages\Ruby\libs;…\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site\_ruby\1.8;…\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site\_ruby;…\External\Languages\Ruby\ruby-1.8.6\lib\ruby\1.8"  
/\>

These paths need to point to your MRI installation.

Tomas

---

<div class="post-metadata">

**Author:** ![pozza](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/8e8cbc/32.png) [@pozza](https://www.ruby-forum.com/u/pozza)\
**Post date:** [January 30, 2009, 9:31am UTC](https://www.ruby-forum.com/t/erb/158977/3 "2009-01-30T09:31:04Z")

</div>

Hello,

> There should be a line in ir.exe.config that says something like:
> 
> ```
> <set language="Ruby" option="LibraryPaths" value="..\..\Languages\Ruby\libs\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site_ruby\1.8\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site_ruby\;..\..\..\External\Languages\Ruby\ruby-1.8.6\lib\ruby\1.8\" />
> 
> ```
> 
> These paths need to point to your MRI installation.

just curious (ie. I don’t need this yet): is there currently a way to  
set this programmatically, maybe while instantiating the IronRuby host  
?

– Thibaut

---

<div class="post-metadata">

**Author:** ![pozza](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/8e8cbc/32.png) [@pozza](https://www.ruby-forum.com/u/pozza)\
**Post date:** [January 30, 2009, 10:36am UTC](https://www.ruby-forum.com/t/erb/158977/4 "2009-01-30T10:36:51Z")

</div>

> var engine = IronRuby.Ruby.CreateEngine((setup) =\> { setup.Options[“LibraryPaths”] = “…” });

easy - great!

Thanks,

Thibaut

---

<div class="post-metadata">

**Author:** ![pozza](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/8e8cbc/32.png) [@pozza](https://www.ruby-forum.com/u/pozza)\
**Post date:** [January 30, 2009, 9:57am UTC](https://www.ruby-forum.com/t/erb/158977/5 "2009-01-30T09:57:27Z")

</div>

Yes. Something like this should do:

var engine = IronRuby.Ruby.CreateEngine((setup) =\> {  
setup.Options[“LibraryPaths”] = “…” });

engine.Execute(code);

Tomas

---

<div class="post-metadata">

**Author:** ![pozza](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/8e8cbc/32.png) [@pozza](https://www.ruby-forum.com/u/pozza)\
**Post date:** [January 30, 2009, 2:51pm UTC](https://www.ruby-forum.com/t/erb/158977/6 "2009-01-30T14:51:05Z")

</div>

Tomas M. wrote:

> There should be a line in ir.exe.config that says something like:
> 
> ```
> <set language="Ruby" option="LibraryPaths" 
> 
> ```
> 
> value="…\Languages\Ruby\libs;…\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site\_ruby\1.8;…\External\Languages\Ruby\ruby-1.8.6\lib\ruby\site\_ruby;…\External\Languages\Ruby\ruby-1.8.6\lib\ruby\1.8"  
> /\>
> 
> These paths need to point to your MRI installation.
> 
> Tomas

That worked great! All I had to do is copy the App.Config in the  
\Codeplex-DLR-0.9\ folder over to ir.exe.config and add my path. Thanks!
