Skip to main content

When nokogiri cannot be installed under brew

· One min read
ひかり
Main bloger

The following two errors occurred:

zlib is missing; necessary for building libxml2
xslt is missing. Please locate mkmf.log to investigate how it is failing.

Solution

  • Install libxslt and libxml2
  • Specify the path of libxml2 installed by brew
brew install libxslt libxml2
bundle config build.nokogiri --use-system-libraries --with-xml2-include=$(brew --prefix libxml2)/include/libxml2

Reference sites