# Can't install hpricot on cygwin

**URL:** <https://www.ruby-forum.com/t/cant-install-hpricot-on-cygwin/121202>\
**Category:** Ruby\
**Created:** [November 25, 2007, 9:19am UTC](https://www.ruby-forum.com/t/cant-install-hpricot-on-cygwin/121202 "2007-11-25T09:19:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3bc359/32.png) [@pood](https://www.ruby-forum.com/u/pood)\
**Post date:** [November 25, 2007, 9:19am UTC](https://www.ruby-forum.com/t/cant-install-hpricot-on-cygwin/121202/1 "2007-11-25T09:19:06Z")

</div>

I’m trying to run scRUBYt on winXp, but found out it just doesn’t work.

So the work around is to use cygwin.

I’m trying to install Hpricot

I keep on getting this error:

============  
ERROR: Error installing hpricot:  
ERROR: Failed to build gem native extension.

/usr/bin/ruby.exe extconf.rb install hpricot  
checking for main() in -lc…no  
creating Makefile

make gcc -I. -I. -I/usr/lib/ruby/1.8/i386-cygwin -I. -g -02 -c  
hpricot\_scan.c  
make gcc: Command not found  
make: \*\*\* [hpricot.scan.o] 127

===========

I’ve installed FlexMock using gems just fine in cygwin, so what’s wrong?

When trying to install Mechanize, I get the exact same message, can’t  
make hpricot.

---

<div class="post-metadata">

**Author:** ![pood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3bc359/32.png) [@pood](https://www.ruby-forum.com/u/pood)\
**Post date:** [November 25, 2007, 10:48am UTC](https://www.ruby-forum.com/t/cant-install-hpricot-on-cygwin/121202/2 "2007-11-25T10:48:07Z")

</div>

Feng T. wrote:

> ERROR: Error installing hpricot:
> 
> ===========
> 
> I’ve installed FlexMock using gems just fine in cygwin, so what’s wrong?

I think the trick is that in FlexMock’s case, you did not have to  
compile anything - but this doesn’t hold for Hpricot. You need a C  
compiler. Unfortunately I have no idea how to get that on cygwin, but it  
shouldn’t be that complicated.

Let me know if this solves the problem for you!

Cheers,  
Peter

* * *

[http://www.rubyrailways.com](http://www.rubyrailways.com)  
[http://scrubyt.org](http://scrubyt.org)

---

<div class="post-metadata">

**Author:** ![pood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3bc359/32.png) [@pood](https://www.ruby-forum.com/u/pood)\
**Post date:** [November 25, 2007, 10:53am UTC](https://www.ruby-forum.com/t/cant-install-hpricot-on-cygwin/121202/3 "2007-11-25T10:53:58Z")

</div>

Feng,  
Check your Cygwin installation and make sure you have gcc installed.  
It’s  
under compilers or something like that. It seems that the line that’s  
throwing the error is

make gcc: Command not found

I have a somewhat limited experience with Ruby, Windows XP and Cygwin  
but I  
remember that a gem installed from the Windows command line will work in  
Cygwin too (at least it’s present when I issue a `gem list`)

---

<div class="post-metadata">

**Author:** ![pood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3bc359/32.png) [@pood](https://www.ruby-forum.com/u/pood)\
**Post date:** [November 25, 2007, 10:55am UTC](https://www.ruby-forum.com/t/cant-install-hpricot-on-cygwin/121202/4 "2007-11-25T10:55:43Z")

</div>

Just to be extra clear: if you build it on WinXP you don’t need to  
install  
GCC. If you want to built it in Cygwin, you’ll probably need GCC.

---

<div class="post-metadata">

**Author:** ![pood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3bc359/32.png) [@pood](https://www.ruby-forum.com/u/pood)\
**Post date:** [November 25, 2007, 8:18pm UTC](https://www.ruby-forum.com/t/cant-install-hpricot-on-cygwin/121202/5 "2007-11-25T20:18:05Z")

</div>

my Aptana was causing this problem! doing this thru command line, I  
don’t get this error.

---

<div class="post-metadata">

**Author:** ![pood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3bc359/32.png) [@pood](https://www.ruby-forum.com/u/pood)\
**Post date:** [November 25, 2007, 7:43pm UTC](https://www.ruby-forum.com/t/cant-install-hpricot-on-cygwin/121202/6 "2007-11-25T19:43:29Z")

</div>

that did the trick!

but now i get this error:

===  
/usr/lib/ruby/gems/1.8/gems/hpricot-0.6/lib/hpricot/builder.rb:11:  
warning: `&’ interpreted as argument prefix  
(eval):2: warning: instance variable @is\_simple\_type not initialized  
(eval):2: warning: instance variable @is\_simple\_type not initialized  
(eval):2: warning: instance variable @is\_simple\_type not initialized  
(eval):2: warning: instance variable @is\_simple\_type not initialized  
(eval):2: warning: instance variable @is\_pointer\_type not initialized  
(eval):2: warning: instance variable @is\_pointer\_type not initialized  
(eval):2: warning: instance variable @is\_pointer\_type not initialized  
(eval):2: warning: instance variable @is\_simple\_type not initialized  
(eval):2: warning: instance variable @is\_simple\_type not initialized  
(eval):2: warning: instance variable @is\_pointer\_type not initialized  
(eval):2: warning: instance variable @is\_simple\_type not initialized  
(eval):2: warning: instance variable @is\_simple\_type not initialized  
/cygdrive/c/Documents and Settings/pood is insecure (40770). It may not  
be group or world writable. Exiting.  
and so on…

===

when trying to run this:

===require ‘rubygems’  
require ‘scrubyt’

google\_data = Scrubyt::Extractor.define do  
fetch ‘[Google](http://www.google.com/ncr)’  
fill\_textfield ‘q’, ‘ruby’  
submit

result ‘Ruby P.ming Language’  
end

# google\_data.to\_xml.write($stdout, 1) Scrubyt::ResultDumper.print\_statistics(google\_data)

---

<div class="post-metadata">

**Author:** ![pood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/3bc359/32.png) [@pood](https://www.ruby-forum.com/u/pood)\
**Post date:** [November 26, 2007, 1:01am UTC](https://www.ruby-forum.com/t/cant-install-hpricot-on-cygwin/121202/7 "2007-11-26T01:01:46Z")

</div>

Feng T. wrote:

> my Aptana was causing this problem! doing this thru command line, I  
> don’t get this error.

Great! So welcome to scRUBYt!. Please note that there is a #scrubyt  
channel on [irc.freenode.net](http://irc.freenode.net) now, and I’ll be usually hanging out there,  
so if you need some quick info on how to go on, be sure to drop in!

Cheers,  
Peter

* * *

[http://www.rubyrailways.com](http://www.rubyrailways.com)  
[http://scrubyt.org](http://scrubyt.org)
