Resolving "require"s when executing IronRuby from C#
Posted
by James Sulak
on Stack Overflow
See other posts from Stack Overflow
or by James Sulak
Published on 2010-05-12T17:52:26Z
Indexed on
2010/05/12
17:54 UTC
Read the original article
Hit count: 232
I'm attempting to run an IronRuby script from C#:
var runtime = IronRuby.Ruby.CreateRuntime();
runtime.ExecuteFile("ruby/foo.rb");
foo.rb starts with a "require:"
#!/usr/bin/env ruby
require 'bar'
When I try this, I get an exception stating "no such file to load -- bar." The file "bar.rb" and the directory "bar" are both present in the "ruby" directory.
So, how do I execute a ruby script that requires other ruby files? I'm targeting .Net 3.5.
© Stack Overflow or respective owner