LoginSignup
7
7

More than 5 years have passed since last update.

Mac OS X 10.9 Mavericks で Rails の `bundle install` に失敗する件の対処法

Last updated at Posted at 2013-12-25

Mac OS X を 10.9 Mavericks にバージョンアップした後に、Rails プロジェクトのbundle installが失敗するようになったので、その対処法です。

環境は、rbenv, ruby 2.0.0-p353, Rails 4.0.2 です。

結論から書いておきますと、xcode-select --installしてコマンドラインツールをインストールした後に再実行したら解決しました。

エラーログ

具体的には私の環境では、atomic gem のインストールに失敗するようになりました。C拡張周りのgemをインストールしようとすると同じ症状となるので、他の方々もいろいろなところでこけていたようです。
以下エラー発生時のログです。

$ bundle install
...
省略
...
Installing activerecord-deprecated_finders (1.0.3)
Installing tzinfo (0.3.38)

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /.rbenv/versions/2.0.0-p353/bin/ruby extconf.rb 
*** 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:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/.rbenv/versions/2.0.0-p353/bin/ruby
    --with-atomic_reference-dir
    --without-atomic_reference-dir
    --with-atomic_reference-include
    --without-atomic_reference-include=${atomic_reference-dir}/include
    --with-atomic_reference-lib
    --without-atomic_reference-lib=${atomic_reference-dir}/
/.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:430:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:515:in `try_link0'
    from /.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/mkmf.rb:813:in `try_run'
    from extconf.rb:26:in `<main>'


Gem files will remain installed in /rails-project/vendor/bundle/ruby/2.0.0/gems/atomic-1.1.14 for inspection.
Results logged to /rails-project/vendor/bundle/ruby/2.0.0/gems/atomic-1.1.14/ext/gem_make.out

...
省略
...

対処法

対処法はxcode-select --installしてコマンドラインツールをインストール後に再実行。

SEE ALSO

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