Specifics of ScriptEngine.ExecuteFile

297 Views Asked by At

I've got a very simple bit of code in C# that should load a Ruby script and execute it. It looks like this:

using System;
using System.Collections.Generic;
using System.IO;

using IronRuby;
using Microsoft.Scripting;

namespace RubyCaller
{
    class Program
    {
        static void Main(string[] args)
        {
            var rubyEng = Ruby.CreateEngine();
            rubyEng.ExecuteFile(@".\Scripts\hello.rb");
            Console.ReadLine();
        }
    }
}

The Ruby code is a simple Hello World that executes fine both in IR.exe and when executed using rubyEng.Execute(). When I attempt to execute it this way, I get "NotImplementedException" on the call to ExecuteFile.

What am I missing?

1

There are 1 best solutions below

0
On

Works for me against the latest version of IronRuby. Can you provide the stacktrace for the exception you're getting? Also, are you sure you're using the IronRuby assemblies intended for the .NET framework, and not ones intended for Windows Phone 7 or Silverlight?