Skip to content

Instantly share code, notes, and snippets.

@kakashysen
Created June 29, 2018 04:19
Show Gist options
  • Select an option

  • Save kakashysen/45450e0148450733a7d255891755ea5c to your computer and use it in GitHub Desktop.

Select an option

Save kakashysen/45450e0148450733a7d255891755ea5c to your computer and use it in GitHub Desktop.
Nokogiri error bundle install

Nokogiri error in bundle install

if you get an error like this

ERROR: cannot discover where libxml2 is located on your system. please make sure `pkg-config` is installed.
*** 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.
...

when try to install nokogiri with bundle, just set the following configuration

bundle config build.nokogiri --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2 --use-system-libraries

after that you can run bundle install

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