From: Graham Menhennitt Date: 2012-11-23T05:21:48+09:00 Subject: Re: "undefined method `synchronize' for #" from embedded Ruby program (Solved) This is a multi-part message in MIME format. --------------050707060505030401060105 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 22/11/2012 2:07 PM, Arlen Cuss wrote: > It does seem like a less than perfect solution. :( I note (re: your > comment that derefing argv when argc==0 is probably a bug) that the > offending line does have that somewhat cheeky comment, /* for the time > being */. Yes, I saw that too - I'll file a defect against it. I'll also file one about having to do the fake argc/argv. Anyway, just for completeness and for anybody else looking for a workaround, here is my working test program. Graham #include int main(int argc, char *argv[]) { RUBY_INIT_STACK; ruby_init(); static char* args[] = { "ruby", "/dev/null" }; ruby_process_options(2, args); rb_eval_string("p Mutex.new.methods"); return 0; } --------------050707060505030401060105 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 22/11/2012 2:07 PM, Arlen Cuss wrote:
It does seem like a less than perfect solution. :( I note (re: your comment that derefing argv when argc==0 is probably a bug) that the offending line does have that somewhat cheeky comment, /* for the time being */.
Yes, I saw that too - I'll file a defect against it. I'll also file one about having to do the fake argc/argv.

Anyway, just for completeness and for anybody else looking for a workaround, here is my working test program.

Graham

#include <ruby.h>

int
main(int argc, char *argv[])
{
    RUBY_INIT_STACK;
    ruby_init();
    static char* args[] = { "ruby", "/dev/null" };
    ruby_process_options(2, args);

    rb_eval_string("p Mutex.new.methods");

    return 0;
}

--------------050707060505030401060105--