From: Rolando Abarca Date: 2009-04-21T21:32:03+09:00 Subject: Re: questions about embedding ruby 1.9 On Apr 21, 2009, at 2:05 AM, Nobuyoshi Nakada wrote: > Hi, Hi, > I can't see any problem with following code. > > #include "ruby.h" > > int > main(int argc, char **argv) > { > int state; > ruby_sysinit(&argc, &argv); > { > RUBY_INIT_STACK; > ruby_init(); > rb_protect(RUBY_METHOD_FUNC(rb_require), (VALUE)"./main.rb", &state); > } > return ruby_cleanup(state); > } totally right... you don't need to create a new to just require a file. Is the ruby_sysinit call required? Even if I add it, I'm still getting a bad access error in vm.c:743. For testing purpose, this is my ruby code: # main.rb raise "test exception" And i'm using the exact same code to run the ruby script as the one you proposed. In the line where I get the bad access (vm.c:743), I noticed that th->vm->progname is NULL... I'm guessing this might be the error? > -- > Nobu Nakada thanks!, -- Rolando Abarca M.