[Ironruby-core] Problem with IronRubyMvc and IR 0.9.1

Tomas Matousek Tomas.Matousek at microsoft.com
Wed Oct 14 17:34:47 EDT 2009

Engine.Operations.InvokeMember(null, "require", "xxx");

Raises an exception with the latest bits:
System.MissingMethodException: private method `require' called for nil:NilClass

Which is expected. I forgot the Kernel methods are all private.


-----Original Message-----
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Immo Wache
Sent: Tuesday, October 13, 2009 11:18 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] Problem with IronRubyMvc and IR 0.9.1

Hi Tomas,

No success so far, all variants produce the same exception:
"InvalidOperationException: Empty scope has no global scope." ???

I tried following variants:

  Engine.Operations.InvokeMember(null, "require", PathProvider.MapPath(path));
  Engine.Operations.InvokeMember(Context, "require", PathProvider.MapPath(path));
  Engine.Operations.InvokeMember(Context.TopGlobalScope, "require",
  Engine.Operations.InvokeMember(Engine, "require",
  Engine.Operations.InvokeMember(Engine.Runtime.Globals, "require",
  Engine.Operations.InvokeMember(Engine.GetScope(null), "require",


  Engine = Ruby.GetEngine(Runtime);
  Context = Ruby.GetExecutionContext(Engine);
  CurrentScope = Engine.CreateScope();
  Operations = Engine.CreateOperations();

Any ideas what's wrong?

Hope for some help, Immo

Tomas Matousek wrote:
> “The extension method RequireFile for ruby does that respect when I 
> would redefine the require statement to keep track of classes contained 
> in a file and reload them on each request when compiled in debug mode?”
> No, there is no dynamic invocation of “require” method going on. If you 
> need to call “require” you can use Engine.Operations.InvokeMember(nil, 
> “require”, fileName);
Posted via http://www.ruby-forum.com/.
Ironruby-core mailing list
Ironruby-core at rubyforge.org

More information about the Ironruby-core mailing list