bundle installを実行したらnokogiri関連でエラーが出る
この記事でnokogiriを単体でインストールしてもまだエラーが出る場合の対処法です。
その場合、以下のようなエラーが出ていると思います。
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby2.1 extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
checking for gzdopen() in -lz... yes
checking for iconv... yes
************************************************************************
IMPORTANT NOTICE:
Building Nokogiri with a packaged version of libxml2-2.9.2
with the following patches applied:
- 0001-Revert-Missing-initialization-for-the-catalog-module.patch
- 0002-Fix-missing-entities-after-CVE-2014-3660-fix.patch
...(以下略)
よくよくエラーメッセージを読むと対処法も書いてあるのでそれに従います。
以下のようにオプションを指定してgemインストールし直します。
gem uninstall nokogiri gem install nokogiri -- --use-system-libraries /usr/local/bin/bundle config build.nokogiri --use-system-libraries
これでbundle installが通るはずです。


