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

Claudio Maccari claudio.maccari at gmail.com
Sun Feb 8 12:13:10 EST 2009

Uhmmm. I think you made so mistakes in your project.

I created this very simple Console Application from scratch


    class Program


        static void Main(string[] args)


            var engine = IronRuby.Ruby.CreateEngine();

            engine.Execute("puts 'hello world'");






In order to compile it I need to add this libraries (just taken form






if I press F5 it works like a charm. 

In my bin\debug folder I have 


08/02/2009  18.07             4.608 ACSharpHostingConsole.exe

08/02/2009  18.07            11.776 ACSharpHostingConsole.pdb

08/02/2009  18.08            14.328 ACSharpHostingConsole.vshost.exe

02/02/2009  14.53           688.128 IronRuby.dll

02/02/2009  14.53           548.864 IronRuby.Libraries.dll

02/02/2009  14.52           368.640 Microsoft.Scripting.Core.dll

02/02/2009  14.53           958.464 Microsoft.Scripting.dll

02/02/2009  14.52             5.120





From: ironruby-core-bounces at rubyforge.org
[mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Meinrad Recheis
Sent: domenica 8 febbraio 2009 16.05
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] how to initialize iron ruby from c#


Copy Local is true. That is what confuses me.   

On Sun, Feb 8, 2009 at 1:28 PM, <thibaut.barrere at gmail.com> wrote:

"Copy local" may be set to false ?

-- Thibaut

Le 8 févr. 09 à 12:38, Meinrad Recheis <meinrad.recheis at gmail.com> a écrit :

On Sun, Feb 8, 2009 at 12:33 AM, Meinrad Recheis <meinrad.recheis at gmail.com>

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


This is the inner exception. 


{"Could not load file or assembly 'IronRuby.Libraries, Version=,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system
cannot find the file specified.":"IronRuby.Libraries, Version=,
Culture=neutral, PublicKeyToken=null"}

This happens with the latest nightly build of DLR binaries. I did make sure
that IronRuby.Libraries.dll is added in the References of the project but it
still can't be loaded. Did I miss something obvious?


Hi, I found the cause of the error: IronRuby.Libraries.dll does not get
copied to the bin/debug location on build like the other dependencies (i.e.
IronRuby.dll, etc. ) despite the fact that they are all correctly listed as
references of the project. When I copy it manually everything works fine.
Any idea, why it is not copied automatically? 

-- henon

Ironruby-core mailing list
Ironruby-core at rubyforge.org

Ironruby-core mailing list
Ironruby-core at rubyforge.org


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20090208/c9d4a4af/attachment.html>

More information about the Ironruby-core mailing list