Swig seems to work really well, but you need to make sure you have Swig
1.3 (earlier versions do not support Ruby).  The documentation is really
centered around writing perl, python, and tcl wrappers with Swig 1.1, but
the Ruby stuff works much the same way.

As Chris pointed out, you definitely need to consider exception-safety
issues.  From what I can tell, swig doesn't by default allocate any C++
objects on the stack unless you use a typemap; if you do use typemaps,
though, you need to be very careful how you write them.  You should also
use swig's %except directive to turn C++ exceptions into Ruby exceptions.

Also, Swig 1.3 doesn't handle multiple modules very well if you put them
into one big shared object (this is because the %import directive uses
rb_f_require, so it won't require the right if your shared object doesn't
have the right name).  So either use separate so's for each module, or be
prepared to hack on swig.

Lastly (and most important), you will need to make some changes to
rubydec.swig:

Add the lines:
  static VALUE _mSWIG = Qnil;
  static VALUE _cSWIG_Pointer = Qnil;

And change the line:
  SWIGEXPORT(void) SWIG_define_class(VALUE, swig_type_info *)
to:
  SWIGEXPORT(void) SWIG_define_class(swig_type_info *);

I submitted a bug report on sourceforge about this, but have not yet
received a response.

Paul