Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error installing nokogiri

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>
like image 914
Ryan Lang Avatar asked Mar 10 '13 08:03

Ryan Lang


People also ask

Is Nokogiri a ruby gem?

Imagine a tool and you most probably have it in your Ruby kit. One of the best gems for Ruby on Rails is Nokogiri which is a library to deal with XML and HTML documents. The most common use for a parser like Nokogiri is to extract data from structured documents.

What does Nokogiri do?

Nokogiri (htpp://nokogiri.org/) is the most popular open source Ruby gem for HTML and XML parsing. It parses HTML and XML documents into node sets and allows for searching with CSS3 and XPath selectors. It may also be used to construct new HTML and XML objects.

What is Ruby Nokogiri?

Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby. It provides a sensible, easy-to-understand API for reading, writing, modifying, and querying documents. It is fast and standards-compliant by relying on native parsers like libxml2 (CRuby) and xerces (JRuby).

What is Nokogiri used for in rails?

Nokogiri is an open source library in Ruby used to read HTML and XML Basically it is used to read information from websites to use for your application.


1 Answers

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.

like image 190
Kevin from MBioEX Avatar answered Sep 20 '22 00:09

Kevin from MBioEX