From: Nobuyoshi Nakada Date: 2006-05-26T14:48:55+09:00 Subject: loading rubygems at startup without RUBYOPT 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