Libxml2 が Mac OS X 10.10 にありません 質問する

Libxml2 が Mac OS X 10.10 にありません 質問する
Running 'compile' for libxslt 1.1.28... OK
Running 'install' for libxslt 1.1.28... OK
Activating libxslt 1.1.28 (from /Users/Kartik/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.4.1/ports/x86_64-apple-darwin14.0.0/libxslt/1.1.28)...
checking for main() in -llzma... yes
checking for xmlParseDoc() in libxml/parser.h... no
checking for xmlParseDoc() in -lxml2... no
checking for xmlParseDoc() in -llibxml2... no

libxml2 が見つかりません。mkmf.log を見つけて、失敗の原因を調べてください。

*** 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.

ベストアンサー1

私はこれをかなり長い間いじっていましたが、次の方法がうまくいきました。

1) homebrewでlibxml2をインストールする

brew install libxml2

2) gemをインストールする

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

おすすめ記事