[Rubygems-developers] require issue with 0.8.10

Jim Weirich jim at weirichhouse.org
Mon Mar 28 23:40:09 EST 2005

On Monday 28 March 2005 08:12 pm, Assaph Mehr wrote:
> The HTMLTools gem, which used to work with gems 0.8.8, now gives me
> grief using gems 0.8.10 due to (I presume) a behaviour change in
> #require.
> I have RUBYOPT=rubygems set  on my machine (WinXP, ruby 1.8.2). I used
> to be able to simply require the files I needed from the gems, e.g.:
>   require 'html/tree'
> which would load fine. 

With RUBYOPT set and gem 0.8.10:

  $ ruby -e 'require "html/tree"; puts "OK"'

> With gems 0.8.10 it doesn't (complaining 
> 'LoadError: No such file to load -- html/tools'). 

What is 'html/tools'?  I didn't see any file by that name (although the name 
of the gem is htmltools).  Nor could I find any reference to that file in the 
source code of htmltools.

> I think that's 
> because all files in the gem are under its lib/html directory, and all
> files require other files (in the same dir) via require
> 'html/somefile'.

That shouldn't be a problem.  It's how I have all my projects setup. 

-- Jim Weirich    jim at weirichhouse.org     http://onestepback.org
"Beware of bugs in the above code; I have only proved it correct, 
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)

More information about the Rubygems-developers mailing list