From: ES Date: 2005-03-05T12:41:42+09:00 Subject: Re: ruby gems, and the require problem (was Re: RAA Status & b) Chad Fowler wrote: > 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? Hm. So there are no cunning plans to take over all of the Rubyists' computers and execute a remote installation of BeOS on them? Well, that makes me feel a lot...sadder :/ Damn you guys. Not even a little cunning? Cunnette? Cunnino? Nanocunny? Er. You see where this is going. Would it be, then, possible to implement a switch that would just append the just-added directory to $LOAD_PATH (RUBYLIB)? It might be prudent, I suppose, to actually create a separate tool to manage the path if it's very large, to avoid duplication. If you won't do it immediately, then I will. THAT'll teach you. Of course, if Gems is at some point added to Ruby core to supplant, supplement or even supplament the standard require mechanism, I'll be all for it. *starts singing the Rubynia national anthem* *why, yes, it IS by Depeche Mode, why do you ask?* > Chad Fowler E