# Annoying problem: gems tries to build native extension

**URL:** <https://www.ruby-forum.com/t/annoying-problem-gems-tries-to-build-native-extension/148692>\
**Category:** Ruby\
**Created:** [September 16, 2008, 9:06am UTC](https://www.ruby-forum.com/t/annoying-problem-gems-tries-to-build-native-extension/148692 "2008-09-16T09:06:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 16, 2008, 9:06am UTC](https://www.ruby-forum.com/t/annoying-problem-gems-tries-to-build-native-extension/148692/1 "2008-09-16T09:06:33Z")

</div>

Hi All,

I have an annoying problem using gems.  
Yesterday I wanted to update all my gems to their latest version.  
For hpricot unfortunately I answered the question “Select which gem to  
install for your platform (i386-mswin32)” with “1” → hpricot-0.6.16  
(ruby)  
I knew immediately this was wrong…  
It tried to build the native extension but I don’t have any VC  
compiler installed therefore it stopped updating the gems.

I cleaned hpricot-0.6.161 from gems\1.8\cache, gems\1.8\specifications  
\ & gems\1.8\gems  
That didn’t help, still the same:

C:\ruby\>gem update  
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.

c:/ruby/bin/ruby.exe extconf.rb update  
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=c:/ruby/bin/ruby

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

Because it installed not correctly “gem list --local” shows “hpricot  
(0.6)” and therefore uninstalling doesn’t work:

C:\ruby\>gem uninstall hpricot -v ‘0.6.161’  
ERROR: While executing gem … (Gem::InstallError)  
Unknown gem hpricot = 0.6.161

I uninstalled Ruby totally and reinstalled it from scratch - but the  
problem is still the same!  
Here is my environment:

C:\ruby\>gem environment  
RubyGems Environment:

- RUBYGEMS VERSION: 1.2.0
- RUBY VERSION: 1.8.7 (2008-05-31 patchlevel 0) [i386-mswin32]
- INSTALLATION DIRECTORY: c:/ruby/lib/ruby/gems/1.8
- RUBY EXECUTABLE: c:/ruby/bin/ruby.exe
- EXECUTABLE DIRECTORY: c:/ruby/bin
- RUBYGEMS PLATFORMS:
  - ruby
  - x86-mswin32-60

- GEM PATHS:
  - c:/ruby/lib/ruby/gems/1.8

- GEM CONFIGURATION:
  - :update\_sources =\> true
  - :verbose =\> true
  - :benchmark =\> false
  - :backtrace =\> false
  - :bulk\_threshold =\> 1000

- REMOTE SOURCES:
  - [http://gems.rubyforge.org/](http://gems.rubyforge.org/)

Does anybody know why it still tries to install this hpricot-0.6.161  
(ruby)?  
Is there somewhere a cache (outside of the Ruby dir) from which it is  
loaded?  
Any help is highly appreciated!

Thanks!

Marcel

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 16, 2008, 9:28am UTC](https://www.ruby-forum.com/t/annoying-problem-gems-tries-to-build-native-extension/148692/2 "2008-09-16T09:28:04Z")

</div>

removed\_email\_address@domain.invalid wrote:

> Hi All,
> 
> I have an annoying problem using gems.

## I too have problem which is probably related. When installing sqlite3-ruby:

C:\gem install sqlite3-ruby --no-rdoc --no-ri  
Building native extensions. This could take a while…  
ERROR: Error installing sqlite3-ruby:  
ERROR: Failed to build gem native extension.

d:/ruby\_186\_287/bin/ruby.exe extconf.rb install sqlite3-ruby --no-rdoc  
–no-ri  
checking for fdatasync() in rt.lib… no  
checking for sqlite3.h… no

nmake  
‘nmake’ is not recognized as an internal or external command,  
operable program or batch file.

## Gem files will remain installed in d:/ruby\_186\_287/lib/ruby/gems/1.8/gems/sqlite 3-ruby-1.2.4 for inspection. Results logged to d:/ruby\_186\_287/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/ sqlite3\_api/gem\_make.out

I think nmake should’t be used on windows platform since compiler is  
usually not present and gems are precompiled.

## However:

## c:\gem install --version 1.2.3 sqlite3-ruby --no-rdoc --no-ri Successfully installed sqlite3-ruby-1.2.3-x86-mswin32 1 gem installed

RubyGems is 1.2.0 fresh install from One-Click Ruby Installer 186-27  
RC1. OS is Windows 2003 R2 SP2.

by  
TheR
