Yosemiteにアップデート後bundle install ができなくなった話

More than 3 years have passed since last update.


Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20150227-81577-1d96vgb.rb extconf.rb
checking if the C compiler accepts ... no
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
The file "/usr/include/iconv.h" is missing in your build environment,
which means you haven't installed Xcode Command Line Tools properly.

To install Command Line Tools, try running `xcode-select --install` on
terminal and follow the instructions. If it fails, open Xcode.app,
select from the menu "Xcode" - "Open Developer Tool" - "More Developer
Tools" to open the developer site, download the installer for your OS
version and run it.
*** 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.

Provided configuration options:

extconf failed, exit code 1

Gem files will remain installed in /Users/***/.gem/ruby/2.0.0/gems/nokogiri- for inspection.
Results logged to /Users/***/.gem/ruby/2.0.0/extensions/universal-darwin-14/2.0.0/nokogiri-
An error occurred while installing nokogiri (, and Bundler cannot continue.
Make sure that `gem install nokogiri -v ''` succeeds before bundling.


gem install 実施

  • エラーの一番下にあるgem installのコマンドを打ってnokogiriはinstallできるもののbundle installはできず。。。

gem install nokogiri -v ''`

別の方法でnokogiri install


  • エラーをよくみたらコマンドラインツールが正しくinstallされてないみたいだからinstallしろと書いてあるので、以下を実行したら正常にbundle installが成功しました。

xcode-select --install