Nokogiri fails to install on OS X

微笑、不失礼 提交于 2019-12-01 12:45:11

问题


There are many posts on this issue, however, there can be a couple of reasons why Nokogiri (version 1.6.x, 1.7.x or 1.8.x) fails to install on OS X.

Related articles:

  • OS X 10.6 Installing Nokogiri

  • cann't install nokogiri 1.6.1 on Mac OS X 10.9 Maveriks


回答1:


Command Line not installed:

This is the easiest one to check and fix: run xcode-select --install in a terminal window to install it, then try installing Nokogiri one more time by running gem install nokogiri.

Some are reporting that they used gem install nokogiri -- --use-system-libraries

Libxml, libxlt are too recent:

This situation is due to the fact that these libraries, when installed using homebrew, may be too recent. This situation leads to incompatibilities and fatal errors during installation.

To fix this, there are 2 main options:

gem install nokogiri -- --use-system-libraries --with-xml2-include=/usr/include/libxml2 --with-xml2-lib=/usr/lib/

or

brew unlink libxml2
brew unlink libxslt
brew unlink libiconv
sudo xcode-select --install
gem install nokogiri

For more details about the reasons why, please refer to issue 1166 on github.



来源:https://stackoverflow.com/questions/44491145/nokogiri-fails-to-install-on-os-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!