Skip to content

Instantly share code, notes, and snippets.

@ianmariano
Created October 9, 2014 15:27
Show Gist options
  • Save ianmariano/5014e0a87d047f50c052 to your computer and use it in GitHub Desktop.
Save ianmariano/5014e0a87d047f50c052 to your computer and use it in GitHub Desktop.
nokogiri cygwin
Make sure libxml2-devel, libxslt-devel and libiconv-devel are installed:
$ gem install nokogiri -- --use-system-libraries --with-xml2-include=/usr/include/libxml2 --with-xml2-lib=/usr/lib --with-xslt-dir=/usr/include/libxslt --with-iconv-include=/usr/include --with-iconv-lib=/usr/lib
@ryayon
Copy link

ryayon commented Sep 17, 2015

Really helpful.

Thanks

@PeterMK85
Copy link

Hmm I've run in the following:

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

    /usr/bin/ruby.exe -r ./siteconf20160210-9276-7w4d0j.rb extconf.rb --use-system-libraries --with-xml2-include=/usr/include/libxml2 --with-xml2-lib=/usr/lib --with-xslt-dir=/usr/include/libxslt --with-iconv-include=/usr/include --with-iconv-lib=/usr/lib
checking if the C compiler accepts ... *** 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.

@bradoc
Copy link

bradoc commented Oct 13, 2017

Worked! Thankyou!

@dickensas
Copy link

this helped, but I got another fix

bundle config build.nokogiri --use-system-libraries --with-xml2-include=/usr/include/libxml2 --with-xml2-lib=/usr/lib --with-xslt-dir=/usr/include/libxslt --with-iconv-include=/usr/include --with-iconv-lib=/usr/lib

then

bundle install

@gounthar
Copy link

this helped, but I got another fix

bundle config build.nokogiri --use-system-libraries --with-xml2-include=/usr/include/libxml2 --with-xml2-lib=/usr/lib --with-xslt-dir=/usr/include/libxslt --with-iconv-include=/usr/include --with-iconv-lib=/usr/lib

then

bundle install

Thanks a bunch, this one worked for me!

@mora-01
Copy link

mora-01 commented Mar 11, 2024

thanks :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment