Ruby – Error installing nokogiri

jekyllnokogirirubywindows

I'm trying to use jekyll and jekyll-s3 using a start command prompt with ruby. When using gem install jekyll-s3 I get an error telling that libxml2 is missing and that I should visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies. When I visit that page it simply says that I need to use gem install nokogiri. However, when I do this I get a similar error.

I found a similar question asked here Error installing Nokogiri 1.5.0 with rails 3.1.0 and ubuntu however, I can't use sudo commands as I'm using windows. I also found this question libxml2 missing when installing nokogiri's gem devkit (windows) and attempted to use the command included in the question and I got the same error output included in the question. The comments there didn't seem to help.

I've included the entire output for the error in installing nokogiri below. I'm guessing that I need to install some sort of prerequisite package/library, but I don't know how. What should I do to get these gems working properly?

ruby 2.0.0p0 (2013-02-24) [x64-mingw32]

C:\Users\Ryan Lang>gem install nokogiri
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri:
    ERROR: Failed to build gem native extension.

C:/Ruby200-x64/bin/ruby.exe extconf.rb
The system cannot find the path specified.
checking for libxml/parser.h... no
-----
libxml2 is missing.  please visit http://nokogiri.org/tutorials/installing_nokog
iri.html for help with installing dependencies.
-----
*** 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:/Ruby200-x64/bin/ruby
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/
    --with-iconv-dir
    --without-iconv-dir
    --with-iconv-include
    --without-iconv-include=${iconv-dir}/include
    --with-iconv-lib
    --without-iconv-lib=${iconv-dir}/
    --with-xml2-dir
    --without-xml2-dir
    --with-xml2-include
    --without-xml2-include=${xml2-dir}/include
    --with-xml2-lib
    --without-xml2-lib=${xml2-dir}/
    --with-xslt-dir
    --without-xslt-dir
    --with-xslt-include
    --without-xslt-include=${xslt-dir}/include
    --with-xslt-lib
    --without-xslt-lib=${xslt-dir}/
    --with-libxslt-config
    --without-libxslt-config
    --with-pkg-config
    --without-pkg-config
    --with-libxml-2.0-config
    --without-libxml-2.0-config
    --with-pkg-config
    --without-pkg-config
    --with-libiconv-config
    --without-libiconv-config
    --with-pkg-config
    --without-pkg-config


Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/nokog
iri-1.5.6 for inspection.
Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/nokogiri-1.5.6/ext/nok
ogiri/gem_make.out

C:\Users\Ryan Lang>

Best Answer

I don't think nokogiri with Ruby 2.0.0 and x64 on Windows is supported yet. I'm having a similar problem.

Please go to: https://github.com/sparklemotion/nokogiri/issues/864 and go to the bottom to "watch" the thread for updates.

Related Topic