[Ironruby-core] Running IronRuby script from C#

Tomas Matousek Tomas.Matousek at microsoft.com
Tue Nov 2 15:36:59 EDT 2010

What version of IronRuby do you use?
The file has UTF8 BOM at the beginning and IronRuby 1.0 doesn't support that (MRI 1.8.6 doesn't either). IronRuby 1.1.1 should work fine.


-----Original Message-----
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Timothy Barnes
Sent: Tuesday, November 02, 2010 11:07 AM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] Running IronRuby script from C#

I am trying to get a Ruby file to run through C#.  I was reading through "Ruby Unleashed" (book), and it appears to be easy.  However, I keep getting an error on a very simple test. The text of my programs are:

using System;
using Microsoft.Scripting.Hosting;
using IronRuby;

class Run_Ruby
        static void Main()
            ScriptEngine engine = IronRuby.Ruby.CreateEngine();
puts 'hello'

When I run the program I get:
"MissingMethodException was unhandled"
"undefined method `puts' for main:Object"

I am a novice to C#, but this should be hard.  What am I doing wrong?


Posted via http://www.ruby-forum.com/.
Ironruby-core mailing list
Ironruby-core at rubyforge.org

More information about the Ironruby-core mailing list