From: Simon Strandgaard <0bz63fz3m1qt3001@...> Date: 2003-04-13T22:54:08+09:00 Subject: Re: ruby_script() On Sun, 13 Apr 2003 23:12:39 +0900, ts wrote: > [snip good code example] > If you are doing a rb_require() then I see no "embed" message ? Should'nt it say "embed" in the backtrace ?? > ./a.out hello from ./test.rb:2 ERROR # > cat main.cpp #include #include using namespace std; VALUE myfunc(VALUE) { rb_require("test.rb"); rb_raise(rb_eStandardError, "error"); return Qnil; } int main(int argc, char *argv[]) { ruby_init(); ruby_init_loadpath(); ruby_script("embed"); int error; rb_protect(myfunc, 0, &error); if(error) { VALUE err = rb_inspect(ruby_errinfo); rb_backtrace(); cout << "ERROR " << StringValuePtr(err) << endl; } return 0; } > cat test.rb puts "hello" raise "out" > -- Simon Strandgaard