What replaces RubyEngine.CurrentEngine?

Hi All, I’m updating some demos I did for ASP.NET MVC. In particular my
“ancient” IronRuby view template (rhtml) demo. You guys have been busy!
:wink:

I wanted to update this wiki entry
http://ironruby.rubyforge.org/wiki/wiki.pl?ExecutingIronRubyFromCSharp
And I don’t know what recplaces the line:

RubyEngine re = RubyEngine.CurrentEngine;

Could someone point me in the right direction?

Thanks!
Phil H.

p.s.
Could we get a prominent link to this wiki from
http://www.ironruby.net/?

p.p.s
http://ironruby.net/ doesn’t point to the same place as
www.ironruby.net. Could someone fix the DNS? :wink:

Ha! I’m just preparing it in case I run out of time and need something
else whiz-bang to demo. So if I don’t get it working, oh well. I’ll
dance like a monkey for half an hour.

I’m using the most recent build. I grabbed from trunk and compiled.
Unless someone has a public interface, I’ll cheat and use reflection to
grab that. :wink:

Please help! Don’t make me cheat. :slight_smile:

Phil

Hey Phil,

The way I’ve been doing it has been:

ScriptDomainManager manager = ScriptDomainManager.CurrentManager;
LanguageProvider ruby =
manager.GetLanguageProvider(“ruby”);
ScriptEngine eng = ruby.GetEngine();
RubyEngine rubyEng = ((RubyEngine)eng);

dunno if that will help you.

On 12/3/07, Phil H. [email protected] wrote:

Hi All, I’m updating some demos I did for ASP.NET MVC.

Better get cracking; only seven hours until the demo! :stuck_out_tongue:

I don’t know the correct answer, but if you were using the most recent
public update of the source code you could still use
RubyEngine.CurrentEngine – you just have to work around the fact that
it’s declared “internal”.


Curt H.
[email protected]

Thanks Tomas! That got me much further. Now I get the following:

Could not load file or assembly ‘IronRuby, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its
dependencies. The located assembly’s manifest definition does not match
the assembly reference. (Exception from HRESULT: 0x80131040)

||

Line 28: {
Line 29: ScriptDomainManager manager =
ScriptDomainManager.CurrentManager;
Line 30: LanguageProvider ruby =
manager.GetLanguageProvider(“ruby”);
Line 31: ScriptEngine eng = ruby.GetEngine();
Line 32: RubyEngine rubyEng = ((RubyEngine)eng);

I assume that’s because I compiled IronRuby and it’s not strongly
signed.

Yep, I think Peter’s right. The relevant piece of code seems to be in
Hosting\ScriptEnvironmentSetup.cs, line 139 in the DLR assembly.

Odd, I tried that and still had problems. This is what fixed it for me:

LanguageProvider ruby =
manager.GetLanguageProvider(typeof(RubyLanguageProvider));

I just explicitly passed in the type. All’s good now. Thanks for the
help!

Tomas R.:

Yep, I think Peter’s right. The relevant piece of code seems to be in
Hosting\ScriptEnvironmentSetup.cs, line 139 in the DLR assembly.

Yes - this is a problem with SIGNED leaking into the project files. I
need to modify the Rakefile to scrub SIGNED from the generated .csproj
files that y’all use. For the time being, just remove SIGNED from the
.csproj files and you should be good to go.

-John

I believe there is a conditional compilation symbols called SIGNED. If
you
remove that from all the projects, then the language loading mechanism
doesn’t try to use the public key. I think!

Pete

From: [email protected]
[mailto:removed_ema[email protected]] On Behalf Of Phil H.
Sent: Monday,03 December 03, 2007 21:27
To: [email protected]
Subject: Re: [Ironruby-core] What replaces RubyEngine.CurrentEngine?

Thanks Tomas! That got me much further. Now I get the following:

Could not load file or assembly ‘IronRuby, Version=1.0.0.0,
Culture=neutral,
PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The located
assembly’s manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040)

Line 28: {
Line 29: ScriptDomainManager manager =
ScriptDomainManager.CurrentManager;
Line 30: LanguageProvider ruby =
manager.GetLanguageProvider(“ruby”);
Line 31: ScriptEngine eng = ruby.GetEngine();
Line 32: RubyEngine rubyEng = ((RubyEngine)eng);

I assume that’s because I compiled IronRuby and it’s not strongly
signed.

Tomas R. wrote:

Hey Phil,

The way I’ve been doing it has been:

ScriptDomainManager manager = ScriptDomainManager.CurrentManager;
LanguageProvider ruby =
manager.GetLanguageProvider(“ruby”);
ScriptEngine eng = ruby.GetEngine();
RubyEngine rubyEng = ((RubyEngine)eng);

dunno if that will help you.

On 12/3/07, Phil H. mailto:[email protected] [email protected]
wrote:

Ha! I’m just preparing it in case I run out of time and need something
else whiz-bang to demo. So if I don’t get it working, oh well. I’ll
dance like a monkey for half an hour.

I’m using the most recent build. I grabbed from trunk and compiled.
Unless someone has a public interface, I’ll cheat and use reflection to
grab that. :wink:

Please help! Don’t make me cheat. :slight_smile:

Phil

Curt H. wrote:

On 12/3/07, Phil H. mailto:[email protected] [email protected]
wrote:

Hi All, I’m updating some demos I did for ASP.NET MVC.

Better get cracking; only seven hours until the demo! :stuck_out_tongue:

I don’t know the correct answer, but if you were using the most recent
public update of the source code you could still use
RubyEngine.CurrentEngine – you just have to work around the fact that
it’s declared “internal”.


Curt H.
[email protected]


Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs