Libxml2 missing mac os x 10.10

独自空忆成欢 提交于 2019-11-28 03:58:29

i fiddled around with this for quite a while and the following worked for me..

1) install libxml2 with homebrew

brew install libxml2

2) install the gem via

sudo env ARCHFLAGS="-arch x86_64" gem install nokogiri:1.6.4.1 -- --use-system-libraries --with-xml=/usr/local/Cellar/libxml2/

For any who are still getting "libxml2 version 2.6.21 or later is required!" message, removing --use-system-libraries from hlv's step 2 above, worked for me.

sudo env ARCHFLAGS="-arch x86_64" gem install nokogiri:1.6.4.1 -- --with-xml=/usr/local/Cellar/libxml2/2.9.2/

I finally ended up with this version independent line:

sudo env ARCHFLAGS="-arch x86_64" gem install nokogiri  -n /usr/local/bin -- --with-xml=/usr/local/Cellar/libxml2/
jakob.j

This worked for me (assuming Xcode is installed):

gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.‌platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2 --use-system-libraries

Inspired by https://stackoverflow.com/a/28767045/1884907 (credits to lx00st)

(For MacOX 10.12.x) Perhaps you want to brew install libxml2 and also try linking into /usr/local/ first: brew link --force libxml2, then try that gem install nokogiri -- --use-system-libraries.

Using ports:

gem install nokogiri -- --use-system-libraries --with-xml=/opt/local/lib/libxml2.a

My solution, using ports:

sudo ARCHFLAGS='-arch x86_64' gem install nokogiri -- --use-system-libraries

By default, it will compile for x86_64 and i386, architecture for i386 should disabled, because the dependencies libraries in port only provide x86_64 version by default.

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