From: Patrick Fernie Date: 2005-06-28T23:20:46+09:00 Subject: Re: RubyGems Issue Ah, this makes sense. Will the patched require eventually load by the gem library name? This seems a little more natural, but then again I suppose it leads to the problem of maintaining gemified and non-gemified versions (whereas using the straight library name doesn't). I suppose if I had paid more attention to the documentation/examples provided by the gems I install, this would have been obvious. Thanks, Patrick On 6/28/05, Ryan Davis wrote: > > On Jun 25, 2005, at 3:02 PM, Patrick Fernie wrote: > > > I'm having a not-so-critical-but-still-irritating issue with > > rubygems. It installed fine, and i can use gems, but only using > > require_gem; using the redefined require (from custom_require.rb) > > results in a load error. > > The difference is that require_gem refers to the gem name and the > patched require does not, it still refers to the library name. > Another example is my gem ParseTree. You can do: > > require 'rubygems' > require_gem 'ParseTree' # auto-requires parse_tree > require 'sexp_processor' > > Since require_gem can only (currently) auto-require a single library, > if you want sexp_processor, you have to do that with a regular > require. Alternatively, you can leave the gem names out of it: > > require 'rubygems' require nil # require for non-gem setups > require 'parse_tree' > require 'sexp_processor' > > Either one works fine. I prefer the latter and am switching all my > code to it. > > -- > ryand-ruby@zenspider.com - Seattle.rb - http://www.zenspider.com/ > seattle.rb > http://blog.zenspider.com/ - http://rubyforge.org/projects/ruby2c > > >