Embedding Ruby as a plugin (e.g. PhotoShop)
Glenn Lewis <NoSpam <at> NoSpam.com>
2004-01-01 00:47:41 GMT
I'm trying to embed Ruby as a plugin to a program called
Animation:Master (http://www.hash.com/). Everything compiles
and links without errors, and my plugin loads into A:M, and
my file requestor pops up for selecting which script I wish
to run through the Ruby interpreter.
After this, though, I can't seem to get Ruby to run.
If I try this:
int myargc = 2;
char* myargv[] = { "ruby", "c:/src/hi.rb", 0 };
ruby_init();
ruby_options(myargc, myargv);
ruby_run(); // - crash
the entire application crashes on the call to ruby_run.
If, however, I try this:
ruby_init();
ruby_script("embedded");
rb_load_file("c:/src/hi.rb");
ruby_run(); // - hangs
the entire application just hangs... I have to kill it myself.
Just to test out my sanity, I built a separate executable with
the above 2 snipits, and each of them worked fine as a stand-alone
program.
(Continue reading)