LoginSignup
1
1

More than 5 years have passed since last update.

libxml2がインストール済みなのにnokogiriのインストールで怒られるときの対処法

Posted at

僕は間違ってない!!悪いのはパソコンだ!!

ruby 2.1.3、MacOS 10.9.4にnokogiriをインストールしようとしたんです。

Building nokogiri using system libraries.
libxml2 version 2.6.21 or later is required!

途中省略

っていうエラーがでてnokogiriをインストール出来ない。
もちろん、Homebrewでlibxml2はインストール済みで、バージョンは2.9.1なので上記の条件を満たしている。僕は間違っていない、パソコンが悪い、そうでしょ?

...こういう場合は大抵の場合参照先が間違っている。
というわけで、以下のコマンドで参照先を修正

bundle config build.nokogiri "--use-system-libraries --with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2"
bundle install

できた。間違っていたのは僕でした。本当にすいませんでした。

1
1
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
1
1