Hello everyone,

I'm trying to call a Ruby program from C and pass it some arguments.
Here is a trivial program that demonstrates the problem. The Ruby
documentation states that you can set the Ruby arguments using
ruby_options. I know that if I pass no arguments it waits forever
listening to STDIN. Thats fine. The problem is that when I do pass
arguments Ruby just dies - no crash, nothing, just a silent exit.

Any idea what I'm doing wrong? Should I be using a different call to set
the arguments?

I'm using Ruby 1.8.1

int main(int argc, char* argv[])
{
        NtInitialize(&argc, &argv);     // this bit need for Windows

        ruby_init();
        ruby_script("embedded");

        char    *rubyArgs[] =
        {
                "arg1",
                "arg2",
                "arg3",
        };

        // this function should set the arguments to the ruby program
        // however Ruby silently dies at this point

        ruby_options(sizeof(rubyArgs) / sizeof(rubyArgs[0]), rubyArgs);

        // the code never gets here

        rb_load_file("e:\\doTheWork.rb");
        ruby_run();

        return 0;
}

Stephen
-- 
Stephen Kellett
Object Media Limited    http://www.objmedia.demon.co.uk
RSI Information:        http://www.objmedia.demon.co.uk/rsi.html