From: Richard Kilmer Date: 2004-09-16T13:07:41+09:00 Subject: Re: [ANN] RubyGems 0.8.0 I STRONGLY suggest the RUBYOPT thing. And, because rubygems starts with an 'r' we actually have a file named ubygems.rb which enables: ruby -rubygems And the RUBYOPT can be: rubygems So the double 'r' is not necessary. But like Chad said, this feature lets you just use a standard 'require' statement on any file in any gem and it does an automatic 'require_gem' for you transparently. To do this we override the require method. So, if in your scripts you perform a bogus require you may get a message like: irb(main):001:0> require 'foo' LoadError: No such file to load -- foo from /usr/local/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in `require__' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/loadpath_manager.rb:5:in `require' from (irb):1 You notice the double require and require__ in the call stack. This is what enables our transparency. If you need to require a gem of a prior version though, you can still use require_gem "GemName", "= x.y.z" to get that version. The require hack always loads the latest version. Best, Rich On 9/15/04 11:55 PM, "Chad Fowler" wrote: > Instead of cluttering up the site_ruby directory with library/stub > files, we can now load library files out of any installed gem without > having to "require_gem" first. However, you'll have to first "require > 'rubygems'" in order for this functionality to work. The easiest way > to do this is to either pass "-rrubygems" on ruby's command line or set > your RUBYOPT environment variable to include "rrubygems". The > rubygems.rb file itself has been made to be VERY lightweight, so it > should not be intrusive to load.