From: Ross Bamford Date: 2006-11-25T04:49:34+09:00 Subject: Re: Gem dependency (Hpricot) On Wed, 22 Nov 2006 12:38:13 -0000, Han Holl wrote: > Hi, > > This is from Hpricot's install page: > > If you'd prefer not to use RubyGems, you can also acquire a plain Ruby > distribution: http://code.whytheluckystiff.net/dist/hpricot-0.4.tgz > > However, if you download, and try to build with rake, you get: > bever:/usr/src/ruby/hpricot-0.4> rake > (in /home/source/src/ruby/hpricot-0.4) > rake aborted! > no such file to load -- rubygems > /home/source/src/ruby/hpricot-0.4/Rakefile:3:in `require' > (See full trace by running task with --trace) > > So not preferring to use gems doesn't really buy you much. > > Han Holl > > PS I'm sending this to this list because Hpricot is not alone in this. > Dependencies on gem are not good. Of course I'll give in, install gem, > and subsequent dependencies will go unnoticed here, until I try to run > something on a different computer. > I think that most projects whose Rakefile depends on Gems do so because they need Gem::Specification for the Rake GemPackageTask. Generally I tend to leave out an explicit require and do something like: require 'rubygems' rescue nil # .... later: if ! defined?(Gem) warn "Package Target requires RubyGEMs" else spec = Gem::Specification.new do |s| ... end end -- Ross Bamford - rosco@roscopeco.remove.co.uk