From: Chad Fowler Date: 2005-03-05T03:31:47+09:00 Subject: Re: ruby gems, and the require problem (was Re: RAA Status & b) On Sat, 5 Mar 2005 03:08:03 +0900, ES wrote: > Chad Fowler wrote: > > On Sat, 5 Mar 2005 00:43:45 +0900, Austin Ziegler wrote: > > > >>Ultimately, I agree with you. Ruby needs RubyGems in the core as a > >>replacement to require without doing 'require "rubygems"'. But it > >>does solve a very real problem, and it solves it reasonably well. > >> > > > > > > Well put. I think a lot of the fire would fade out of this debate if > > RubyGems were integrated into Ruby in such a way that it didn't > > require anything "special" to work. That has always been our hope and > > intent. > > 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. Let's hope I can make it concise and clear :) .... RubyGems allows you to install multiple versions of the same library. In order to get Ruby to load the one you actually want at runtime, it modifies the $LOAD_PATH. If we didn't do require_gem or override require, you would have to set your $LOAD_PATH (or -I on the command line) to include the library's installation directory, a la: ruby -I /usr/local/lib/ruby/gems/1.8/gems/redcloth-3.0.0/lib myscript.rb Does that explanation make sense? -- Chad Fowler http://chadfowler.com http://rubycentral.org http://rubygarden.org http://rubygems.rubyforge.org (over 100,000 gems served!)