Re: how to initialize iron ruby from c#


#1

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

From: Thibaut Barr?re 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