# Gem dependency (Hpricot)

**URL:** <https://www.ruby-forum.com/t/gem-dependency-hpricot/76917>\
**Category:** Ruby\
**Created:** [November 22, 2006, 1:38pm UTC](https://www.ruby-forum.com/t/gem-dependency-hpricot/76917 "2006-11-22T13:38:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hanholl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a87d85/32.png) [@hanholl](https://www.ruby-forum.com/u/hanholl)\
**Post date:** [November 22, 2006, 1:38pm UTC](https://www.ruby-forum.com/t/gem-dependency-hpricot/76917/1 "2006-11-22T13:38:31Z")

</div>

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](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 H.

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.

---

<div class="post-metadata">

**Author:** ![hanholl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a87d85/32.png) [@hanholl](https://www.ruby-forum.com/u/hanholl)\
**Post date:** [November 22, 2006, 6:29pm UTC](https://www.ruby-forum.com/t/gem-dependency-hpricot/76917/2 "2006-11-22T18:29:16Z")

</div>

On Wed, Nov 22, 2006 at 09:38:13PM +0900, Han H. wrote:

> So not preferring to use gems doesn’t really buy you much.

Oh, I’m sorry, there should be a setup.rb in there. I’ve just updated  
the file  
give it a try again. The installation commands is just `ruby setup.rb`.

\_why

---

<div class="post-metadata">

**Author:** ![hanholl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a87d85/32.png) [@hanholl](https://www.ruby-forum.com/u/hanholl)\
**Post date:** [November 23, 2006, 11:35am UTC](https://www.ruby-forum.com/t/gem-dependency-hpricot/76917/3 "2006-11-23T11:35:29Z")

</div>

On 11/22/06, \_why [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Oh, I’m sorry, there should be a setup.rb in there. I’ve just updated the file  
> give it a try again. The installation commands is just `ruby setup.rb`.

Thanks. It doesn’t seem to be in SVN though, which is what I use.  
It’s no big deal, and I’m very enthioustastic about Hpricot.  
Before this I experimented with htree, to\_rexml and xpath, but this  
combo was to slow to be workable.  
The README file, by the way, ends rather abrubtly.

Han H.

(Gmail seems to encourage top-posting, strange)

---

<div class="post-metadata">

**Author:** ![hanholl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a87d85/32.png) [@hanholl](https://www.ruby-forum.com/u/hanholl)\
**Post date:** [November 24, 2006, 10:43pm UTC](https://www.ruby-forum.com/t/gem-dependency-hpricot/76917/4 "2006-11-24T22:43:25Z")

</div>

On Wed, 22 Nov 2006 13:12:05 -0000, Ross B.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 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:

Oops, I meant explicit dependency (in gems) rather than explicit  
require.

---

<div class="post-metadata">

**Author:** ![hanholl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a87d85/32.png) [@hanholl](https://www.ruby-forum.com/u/hanholl)\
**Post date:** [November 24, 2006, 9:30pm UTC](https://www.ruby-forum.com/t/gem-dependency-hpricot/76917/5 "2006-11-24T21:30:58Z")

</div>

On Wed, 22 Nov 2006 12:38:13 -0000, Han H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> rake aborted!  
> 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
