Thursday, October 21, 2010

ERROR: Failed to build gem native extension whenever we install a gem on windows

When i tried to install a hpricot (gem install hpricot) then i received the following error

Building native extensions. This could take a while...
ERROR: Error installing hpricot:
ERROR: Failed to build gem native extension.

C:/Ruby187/bin/ruby.exe extconf.rb
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
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby187/bin/ruby


Gem files will remain installed in C:/Ruby187/lib/ruby/gems/1.8/gems/hpricot-0.8
.2 for inspection.
Results logged to C:/Ruby187/lib/ruby/gems/1.8/gems/hpricot-0.8.2/ext/fast_xs/ge
m_make.out

---------------

To fix this all i did was gem install (gemname) --platform=mswin32 (gemname is hpricot in my case)

No comments:

Post a Comment