LoginSignup
11
9

More than 5 years have passed since last update.

Mac を El Capitan にアップデートしたあとに gem がコケる件

Posted at

一周遅れで El Capitan にアップデートしたところ、
以前はできていた gem のインストールができなかった。

$ sudo gem install jekyll-import

解決

下記の手順が必要だった。

  1. Xcode コマンドラインツールをのインストール
    1. xcode-select --install
  2. sudo gcc --version でライセンスに同意
    1. スペースキーでライセンスを読む
    2. agree と入力

困ってる人の検索用にエラーメッセージ。

Building native extensions.  This could take a while...
ERROR:  Error installing jekyll-import:
    ERROR: Failed to build gem native extension.

    /Users/***/.rbenv/versions/2.1.2/bin/ruby extconf.rb
checking for ffi.h... *** 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=/Users/***/.rbenv/versions/2.1.2/bin/ruby
    --with-ffi_c-dir
    --without-ffi_c-dir
    --with-ffi_c-include
    --without-ffi_c-include=${ffi_c-dir}/include
    --with-ffi_c-lib
    --without-ffi_c-lib=${ffi_c-dir}/lib
    --with-libffi-config
    --without-libffi-config
    --with-pkg-config
    --without-pkg-config
/Users/***/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /Users/***/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:587:in `try_cpp'
    from /Users/***/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:1067:in `block in have_header'
    from /Users/***/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for'
    from /Users/***/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'
    from /Users/***/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:321:in `open'
    from /Users/***/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'
    from /Users/***/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:321:in `open'
    from /Users/***/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'
    from /Users/***/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for'
    from /Users/***/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:1066:in `have_header'
    from extconf.rb:16:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/***/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/ffi-1.9.14 for inspection.
Results logged to /Users/***/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-14/2.1.0-static/ffi-1.9.14/gem_make.out
11
9
3

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