* ES <ruby-ml / magical-cat.org> [2005-03-05 03:08:03 +0900]:

> Chad, why does Gems need to override #require (or provide #require_gem)?
> I haven't been able to find a concise explanation and I'd rather not
> poke around source code.

I'm not Chad, but...
it's because $: (aka $LOAD_PATH) does not contain the gem path.

 ruby -e '$:.each { |i| p i }'
 "<prefix>/lib/ruby/site_ruby/1.8"
 "<prefix>/lib/ruby/site_ruby/1.8/powerpc-darwin7.7.0"
 "<prefix>/lib/ruby/site_ruby"
 "<prefix>/lib/ruby/1.8"
 "<prefix>/lib/ruby/1.8/powerpc-darwin7.7.0"
 "."

 ls -alF <prefix>/lib/ruby/
 total 0
 drwxr-xr-x    5 jdf  jdf   170 27 Dec 09:13 ./
 drwxr-xr-x    7 jdf  jdf   238 26 Dec 17:17 ../
 drwxr-xr-x  129 jdf  jdf  4386  9 Jan 00:56 1.8/
 drwxr-xr-x    3 jdf  jdf   102 27 Dec 09:13 gems/
 drwxr-xr-x    6 jdf  jdf   204  2 Jan 09:33 site_ruby/

Jim Freeze
Code Red. Code Ruby