LoginSignup
17
17

More than 5 years have passed since last update.

El Capitan で library not found for -lgmp が発生する時の対処法

Last updated at Posted at 2015-10-05

OS を El Capitan にアップデートしてから遭遇した問題のメモ。

library not found for -lgmp が発生

gem をインストールしようとしたら下記のようなエラーが発生。

guest1-107:app t-fujiki$ bundle install
Fetching gem metadata from https://rubygems.org/.............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Using i18n 0.7.0
Installing json 1.8.3 with native extensions

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

    /Users/t-fujiki/.rbenv/versions/2.2.3/bin/ruby -r ./siteconf20151005-20477-hk2ir0.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling generator.c
linking shared-object json/ext/generator.bundle
ld: library not found for -lgmp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [generator.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/t-fujiki/Development/iOS/iosApp/vendor/bundler/ruby/2.2.0/gems/json-1.8.3 for inspection.
Results logged to /Users/t-fujiki/Development/iOS/iosApp/vendor/bundler/ruby/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/json-1.8.3/gem_make.out
An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.3'` succeeds before bundling.

対処法

コマンドラインツールをインストールしたら成功するようになりました。

xcode-select --install
17
17
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
17
17