From: Ross Bamford Date: 2006-03-24T03:47:54+09:00 Subject: Re: Problem seeing classes in rubygem On Fri, 2006-03-24 at 02:52 +0900, Mark Volkmann wrote: > On 3/23/06, Ross Bamford wrote: > > On Fri, 2006-03-24 at 01:51 +0900, Wes Gamble wrote: > > > I have installed the gem correctly (it shows up when I do gem -list) and > > > my require_gem statement succeeds. > > > > > > However, when I go to instantiate one of the classes defined in this > > > gem, the call fails with: > > > > > > unitialized constant: BeautifulSoup > > > > > > on line 4 of my test case below. > > > > > > Here is my test case: > > > > > > require 'rubygems' > > > require_gem 'rubyful_soup', '>= 1.0.4' > > > > > > parser = BeautifulSoup.new(%{"kajsdlfkjads"}) > > > > require_gem does (by default) actually require anything inside the gem - > > I assume you meant "doesn't" above. > Oops, yes, typo there. > Based on what you've said it seems that > 1) There is no point in using require_gem unless you want to specify > version constraints instead of just using the newest version of the > gem. > 2) Since autorequire is being deprecated, you should never just use > require_gem. You should also use a require to pull in a specific file > within the gem. Yes, in fact I think that's what the Gems team now recommend. -- Ross Bamford - rosco@roscopeco.REMOVE.co.uk