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

Meinrad Recheis meinrad.recheis at gmail.com
Sun Feb 8 05:29:02 EST 2009


> Date: Sun, 8 Feb 2009 01:20:48 +0100
>
From: Thibaut Barr?re <thibaut.barrere at gmail.com>
>
Subject: Re: [Ironruby-core] how to initialize iron ruby from c#
>
To: ironruby-core at rubyforge.org
>
Message-ID:
>
       <4a68b8cf0902071620s6ab94899y167f0d8006c781d9 at mail.gmail.com>
>
Content-Type: text/plain; charset="iso-8859-1"
>

> >
>
> Hi there,
>
>
>
> I am trying to initialize an iron ruby engine for execution of code
>
> snipptes from a c# application. extensive googling has not helped me with
>
> the task because there seem to have been much changes in iron ruby lately.
>
> Here is my code:
>
>
>
> var runtime = Ruby.CreateRuntime();
>
> var engine = m_runtime.GetEngine("IronRuby"); // <---
>
> InvalidImplementationException is thrown here
>
>
>

> 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 Matousek):
>

> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20090208/f05615e8/attachment.html>


More information about the Ironruby-core mailing list