5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

`bundle install` で入れるnokogiriにも、システムのlibxml2を使って欲しい

Posted at

gemの依存関係ににnokogiriとかが入ってると、
普通に bundle install したときに、libxml2が無いって怒られる。

あちこち調べると、Homebrewでlibxml2入れてそれ使う、ってでてくるけど。
どうやらXcodeにlibxml2が入ってるらしいので、brew link --force とかで環境を汚したりはしたくない!
できるだけシステムのlibxml2を使いたい!!

環境

  • MacOS X 10.10.2
  • rbenv
  • ruby 2.2.0
  • Xcode Commandline toolsインストール済み

インストールしたいのは nokogiri (1.6.5)。
ちなみに記事を書いている時点でのnokogiriの最新は1.6.6.2。

やりかた

$ bundle config build.nokogiri --use-system-libraries=true --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2
$ bundle install --path vendor/bundle

bundle config で、各gemのインストールオプションとか設定できるらしい。へー。

参考

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?