Greetings!

Just as a warning, I'm very unfamiliar with the Ruby C API, so I probably haven't the slightest idea what I'm talking about.  ^,^

One of my projects uses loadable scripting interfaces, and the first one I'm working on is Ruby.  However, I continuosly run into this problem with the embedding app bombs out of Ruby is there is so much as the slightest error, which is *extremely* annoying.  I don't see what the reasoning behind the ruby_bug() and such functions that completely exit the app instead of returning an error message to calling code.

In any event, these two lines of code alone cause a crash:

        ruby_init ();	/* init Ruby */
        rb_raise (rb_eTypeError, "error!");	/* just raise some weird error */

The app crashes with output like this:

	ruby: error! (TypeError)
	ruby: [BUG] Segmentation fault
	ruby 1.6.3 (2001-03-28) [i386-linux]
	Aborted

I get similar crashes when loading a ruby source file with invalid ruby code (using rb_require), using any of the rb_funcall* functions, etc.

I noticed similar behaviour with the eruby module.  (specifying a non-existant file to read in causes a crash with similar output to that above.)  However, it seems to intelligently handle errors.  I don't understand 90% of the ruby-centric code in eruby, since I'm very new to the Ruby C API.

What exactly can I do to make my Ruby embedding experience more stable?  Is there some underlying flaw in Ruby (the problem with eruby leads me to believe that), or is there some way to intelligently handle Ruby errors?  The documentation is rather lacking...

Thanks everyone!!