[Ironruby-core] Can't run script after engine exception

Aaron Clauson lists at ruby-forum.com
Mon Feb 18 23:17:21 EST 2008

Hi All,

I've got a problem where if I execute a Ruby script that has a syntax
error or missing method and that correctly fails I cannot use that
engine object to subsequently execute a valid script. If I restart the
application and re-execute the corrected script it works. It's only
executing an erroneous script and then a valid script that fails.

The code I'm using to run the script is:

IScriptEnvironment scriptEnvironment = IronRuby.CreateRuntime();
IScriptEngine rubyengine = IronRuby.GetEngine(scriptEnvironment);
SourceUnit scriptSource =
IScriptScope scope = rubyengine.CreateScope();
rubyengine.Execute(scope, scriptSource);

Does anyone know if there is anyway to re-initialise the Ruby engine
after a syntax or methodmissing exception so scripts can be executed
again without needing to restart the application?


Posted via http://www.ruby-forum.com/.

More information about the Ironruby-core mailing list