# Missing header stdio.h? (when updating hpricot gem)

**URL:** <https://www.ruby-forum.com/t/missing-header-stdio-h-when-updating-hpricot-gem/147172>\
**Category:** Ruby\
**Created:** [August 29, 2008, 2:53am UTC](https://www.ruby-forum.com/t/missing-header-stdio-h-when-updating-hpricot-gem/147172 "2008-08-29T02:53:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![carluva](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/76d3ee/32.png) [@carluva](https://www.ruby-forum.com/u/carluva)\
**Post date:** [August 29, 2008, 2:53am UTC](https://www.ruby-forum.com/t/missing-header-stdio-h-when-updating-hpricot-gem/147172/1 "2008-08-29T02:53:09Z")

</div>

I just ran ‘gem update’ this evening, and during the update for hpricot,  
I got a rather surprising error. Here’s the complete output from gem:

* * *

Updating installed gems  
Updating hpricot  
Building native extensions. This could take a while…  
ERROR: While executing gem … (Gem::Installer::ExtensionBuildError)  
ERROR: Failed to build gem native extension.

d:/ruby/bin/ruby.exe extconf.rb update hpricot  
checking for stdio.h… no  
\*\*\* extconf.rb failed \*\*\*  
Could not create Makefile due to some reason, probably lack of  
necessary libraries and/or headers. Check the mkmf.log file for more  
details. You may need configuration options.

Provided configuration options:  
–with-opt-dir  
–without-opt-dir  
–with-opt-include  
–without-opt-include=${opt-dir}/include  
–with-opt-lib  
–without-opt-lib=${opt-dir}/lib  
–with-make-prog  
–srcdir=.  
–curdir  
–ruby=d:/ruby/bin/ruby

## Gem files will remain installed in d:/ruby/lib/ruby/gems/1.8/gems/hpricot-0.6.161 for inspection. Results logged to d:/ruby/lib/ruby/gems/1.8/gems/hpricot-0.6.161/ext/fast\_xs/gem\_make.out

Neither mkmf.log nor gem\_make.out contains any additional helpful  
information. This only seems to happen with hpricot (I have manually  
updated other gems successfully). It sounds like there might be a lib  
missing from the distribution of hpricot.

I don’t actually use that gem at present, so it’s not critical, but it  
piqued my interest, and it’s slightly annoying because gem aborts  
immediately instead of attempting to update the other gems.

- Doug

---

<div class="post-metadata">

**Author:** ![carluva](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/76d3ee/32.png) [@carluva](https://www.ruby-forum.com/u/carluva)\
**Post date:** [August 29, 2008, 8:33am UTC](https://www.ruby-forum.com/t/missing-header-stdio-h-when-updating-hpricot-gem/147172/2 "2008-08-29T08:33:07Z")

</div>

Doug G. wrote:

> I just ran ‘gem update’ this evening, and during the update for hpricot,  
> I got a rather surprising error. Here’s the complete output from gem:
> 
> * * *
> 
> Updating installed gems  
> Updating hpricot  
> Building native extensions. This could take a while…  
> ERROR: While executing gem … (Gem::Installer::ExtensionBuildError)  
> ERROR: Failed to build gem native extension.

It’s attempting to compile it. This error means either you don’t have a  
compiler or your compiler lives in a directory with spaces in it.  
I know that hpricot does compile if these two aren’t the case [i.e. mingw + devkit works fine].  
You could also install an older version that has a precompiled binary.  
-=R

---

<div class="post-metadata">

**Author:** ![carluva](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/76d3ee/32.png) [@carluva](https://www.ruby-forum.com/u/carluva)\
**Post date:** [August 29, 2008, 12:30pm UTC](https://www.ruby-forum.com/t/missing-header-stdio-h-when-updating-hpricot-gem/147172/3 "2008-08-29T12:30:55Z")

</div>

On 29 Aug 2008, at 01:48, Doug G. wrote:

> I just ran ‘gem update’ this evening, and during the update for  
> hpricot,  
> I got a rather surprising error. Here’s the complete output from gem:

Do you have a working C compiler installed? Sounds like you don’t

Fred

---

<div class="post-metadata">

**Author:** ![carluva](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/76d3ee/32.png) [@carluva](https://www.ruby-forum.com/u/carluva)\
**Post date:** [August 29, 2008, 2:43pm UTC](https://www.ruby-forum.com/t/missing-header-stdio-h-when-updating-hpricot-gem/147172/4 "2008-08-29T14:43:50Z")

</div>

Roger P. wrote:  
[snip]

> It’s attempting to compile it. This error means either you don’t have a  
> compiler or your compiler lives in a directory with spaces in it.  
> [snip]

Sounds likely. The same update worked fine on my work machine this  
morning. I’ll take a look when I get home this evening. I wasn’t  
expecting to need a C compiler to install a ruby gem. I’m pretty sure I  
have some version of gcc installed, but I’m not sure where it’s located  
or if I have an environment variable pointing to it.

Thanks,  
Doug

---

<div class="post-metadata">

**Author:** ![carluva](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/76d3ee/32.png) [@carluva](https://www.ruby-forum.com/u/carluva)\
**Post date:** [August 30, 2008, 12:20am UTC](https://www.ruby-forum.com/t/missing-header-stdio-h-when-updating-hpricot-gem/147172/5 "2008-08-30T00:20:25Z")

</div>

> expecting to need a C compiler to install a ruby gem. I’m pretty sure I  
> have some version of gcc installed, but I’m not sure where it’s located  
> or if I have an environment variable pointing to it.

You’ll want to use the same compiler that you Ruby distro was compiled  
in–MSVC 6 or mingw.  
GL!  
-=R

---

<div class="post-metadata">

**Author:** ![carluva](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/76d3ee/32.png) [@carluva](https://www.ruby-forum.com/u/carluva)\
**Post date:** [August 30, 2008, 9:48pm UTC](https://www.ruby-forum.com/t/missing-header-stdio-h-when-updating-hpricot-gem/147172/6 "2008-08-30T21:48:41Z")

</div>

Axel E. wrote:  
[snip]

> See here: [Gem (update ?) problem - Ruby - Ruby-Forum](http://www.ruby-forum.com/topic/162379#new) (last post).
> 
> Best regards,
> 
> Axel

Thanks very much! Doug

---

<div class="post-metadata">

**Author:** ![carluva](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/76d3ee/32.png) [@carluva](https://www.ruby-forum.com/u/carluva)\
**Post date:** [August 30, 2008, 9:39pm UTC](https://www.ruby-forum.com/t/missing-header-stdio-h-when-updating-hpricot-gem/147172/7 "2008-08-30T21:39:38Z")

</div>

-------- Original-Nachricht --------

> Datum: Fri, 29 Aug 2008 09:48:22 +0900  
> Von: Doug G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> An: removed\_email\_address@domain.invalid  
> Betreff: missing header stdio.h??? (when updating hpricot gem)

> d:/ruby/bin/ruby.exe extconf.rb update hpricot  
> –without-opt-include=${opt-dir}/include  
> Results logged to  
> immediately instead of attempting to update the other gems.
> 
> - Doug  
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

See here: [Gem (update ?) problem - Ruby - Ruby-Forum](http://www.ruby-forum.com/topic/162379#new) (last post).

Best regards,

Axel
