Hi,
By linking following extension library statically, rubygems.rb will be
loaded even if no -rubygems option is in RUBYOPT nor command line.
#define RUBY_EXPORT 1
#include "ruby.h"
void Init_rubygems(void)
{
#ifdef IGNORE_NONEXISTENT
static const char so[] = "rubygems.so";
#endif
rb_provide(so);
#ifdef IGNORE_NONEXISTENT
rb_require("rubygems");
rb_ary_delete(rb_gv_get("$\""), rb_str_new2(so));
#endif
}
and `make EXTSTATIC=rubygems' if you put the above under ext/rubygems directory.
Just my 2JPY.
--
Nobu Nakada