From: Bill Atkins Date: 2005-03-23T06:20:03+09:00 Subject: Re: ruby gems, and the require problem (was Re: RAA Status & b) Hmm. What if require 'rubygems' just added the paths for the latest version of all gems to $LOAD_PATH? Would that work? It's a bit of a hack, but this is part of the trouble with RubyGems giving every library and application its own directory. Bill On Sat, 5 Mar 2005 03:31:47 +0900, 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? > -- > > Chad Fowler > http://chadfowler.com > http://rubycentral.org > http://rubygarden.org > http://rubygems.rubyforge.org (over 100,000 gems served!) > > -- $stdout.sync = true "Just another Ruby hacker.".each_byte do |b| ('a'..'z').step do|c|print c+"\b";sleep 0.007 end;print b.chr end; print "\n"