Thanks for the response, Ryan! But it's not ruby_errinfo which is 
causing the issue. In fact, my corrected code is as follows:

ruby_incpush (myFolder);
ruby_init_loadpath();

ruby_set_argv (argc, argv);
ruby_script (myRubyFile);

rb_load_protect (rb_str_new2(myRubyFile, 0, &status);

if (status != 0) {
    VALUE info = rb_errinfo();
    VALUE str = rb_obj_as_string(info); // <-- crashes here
    :
}

And it still crashes when I access rb_obj_as_string(). The problem seems 
to be embedding Ruby in a multi-threaded environment. The same code 
worked fine till Ruby 1.8.7.

Regards,
Muhammad


Ryan Davis wrote in post #1113801:
> On Jun 27, 2013, at 04:08 , Muhammad Ali S. <lists / ruby-forum.com>
> wrote:
>
>>    VALUE info = ruby_errinfo;
>
> According to the changelog, ruby_errinfo was removed in 2005... you
> might want to try something more contemporary.

-- 
Posted via http://www.ruby-forum.com/.