# Re: how to initialize iron ruby from c#

**URL:** <https://www.ruby-forum.com/t/re-how-to-initialize-iron-ruby-from-c/159753>\
**Category:** IronRuby\
**Created:** [February 8, 2009, 11:29am UTC](https://www.ruby-forum.com/t/re-how-to-initialize-iron-ruby-from-c/159753 "2009-02-08T11:29:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Meinrad\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecae2f/32.png) [@Meinrad\_R](https://www.ruby-forum.com/u/Meinrad_R)\
**Post date:** [February 8, 2009, 11:29am UTC](https://www.ruby-forum.com/t/re-how-to-initialize-iron-ruby-from-c/159753/1 "2009-02-08T11:29:59Z")

</div>

> Date: Sun, 8 Feb 2009 01:20:48 +0100

From: Thibaut Barr?re [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> 

Subject: Re: [Ironruby-core] how to initialize iron ruby from c#

> 

To: removed\_email\_address@domain.invalid

> 

Message-ID:

> 

```
   <removed_email_address@domain.invalid>

```

> 

Content-Type: text/plain; charset=“iso-8859-1”

> 

> the task because there seem to have been much changes in iron ruby lately.

> not sure if it will solve your issue, but here’s what I’m using (worked a

few days ago - code snippet sent by Tomas M.):

> 

> var engine = IronRuby.Ruby.CreateEngine();

engine.Execute(code);

> 

> hth,

> – Thibaut

Thanks Thibaut, I tried that, and get the same error. Maybe I should try  
out  
older binaries.

Apart from that, I want to make sure, that my approach to embedding  
IronRuby  
in a .NET app is right (didn’t find any tutorials on embedding):

1. Add references to IronRuby.dll, IronRuby.Libraries.dll,  
Microsoft.Scripting.dll and Microsoft.Scripting.Core.dll
2. Create a engine like this

var engine = IronRuby.Ruby.CreateEngine();

and then executie ruby code on the engine itself with Execute, or  
compile  
code into a ScriptSource and execute that.  
Are there any steps missing? ir.exe has a config file. I don’t need one  
to  
get iron ruby basically running, do I?  
The standard library is embedded in IronRuby.Libraries.dll, so I don’t  
need  
to set a load path, right?

I would be willing to write a tutorial on embedding once I got  
everything  
together and working.

Thanks for clarification,  
– henon
