自从最近的更新(10.14.2)以来,Nokogiri gem无法安装在我的应用程序中。
当我运行bundle install
时,我收到此错误:
./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.
我已经检查了 Nokogiri 的 Mojave 安装指南,但即使在使用此补丁后,它也无法正常工作:
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
设置:
操作系统:OSX 莫哈韦 10.14.2
拼音版本:Ruby 2.4.4P296 (2018-03-28 修订版 63013) [x86_64-达尔文17]
您有什么想法可以解决此问题吗?
提前感谢您的帮助。
日志消息显示 libxml2 丢失。因此,请尝试运行以下命令:
brew install libxml2
如果您安装了自制软件。查看此链接以获取更多信息。