0

Since the recent update (10.14.2) Nokogiri gem cannot be installed in my app.

When I run bundle install, I get this error:

./siteconf20190109-70456-1diyett.rb extconf.rb --use-system-libraries
checking if the C compiler accepts -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE
-fstack-protector-strong -O2 -pipe... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future...
no
Building nokogiri using system libraries.
Using pkg-config gem version 1.3.2
checking for libxml-2.0... yes
checking for libxslt... yes
checking for libexslt... yes
checking for xmlParseDoc() in libxml/parser.h... no
checking for xmlParseDoc() in -lxml2... no
checking for xmlParseDoc() in -llibxml2... no
-----
libxml2 is missing.  Please locate mkmf.log to investigate how it is failing.
-----
*** 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.

I already checked the Nokogiri's installation guide for Mojave, but it does not work, even after having used this patch:

open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

Setup:

OS: OSX Mojave 10.14.2

Ruby version: ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-darwin17]

Do you have any idea to solve this issue?

Thank you in advance for your help.

Charbell
  • 25
  • 10
  • Did it not work for you => https://stackoverflow.com/questions/6277456/nokogiri-installation-fails-libxml2-is-missing ? – Nishutosh Sharma Jan 09 '19 at 18:10
  • Try to reduce the version number in the Gemfile until it works. Use `gem list --all --exact nokogiri` to see all possible versions. (I'm guessing at the options.) Then use `gem 'nokogiri', '~>1.2.3.4'` to get up to 1.2.3.9 or just set it exactly. – Chloe Jan 09 '19 at 19:15
  • @Chloe, the only output I got when I enter the command `gem list --all --exact nokogiri` is `*** LOCAL GEMS *** nokogiri (1.8.4)` – Charbell Jan 09 '19 at 19:47

1 Answers1

1

The log message is saying libxml2 is missing. So, try to run this:

   brew install libxml2

if you have homebrew installed. Check this link for more information.

amalrik maia
  • 478
  • 5
  • 11