0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CatalinaにアップグレードしたmacでrbenvからRuby 2.7.1をインストールしようとしたらgmpが読み込めずに失敗した

Posted at

CatalinaにアップグレードしたmacでrbenvからRuby 2.7.1をインストールしようとした。

$ rbenv install 2.7.1
...
dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib
  Referenced from: /var/folders/p9/38jx3_ks5zb3ml70pccx4g440000gn/T/ruby-build.20200404201643.64758.NBfaXF/ruby-2.7.1/ruby
  Reason: image not found
make: *** [rdoc] Abort trap: 6

で失敗する。

$ ls /usr/local/opt/gmp/lib/
ls: /usr/local/opt/gmp/lib/: No such file or directory

見てみると当該ディレクトリにはなにもない。
しかしインストールしようとするとインストール済みと言われる。

$ brew install gmp
Updating Homebrew...

Error: gmp 6.1.2_2 is already installed
To upgrade to 6.2.0, run `brew upgrade gmp`.

アップグレードしてみる

$ brew upgrade gmp
Updating Homebrew...
==> Upgrading 1 outdated package:
gmp 6.2.0
==> Upgrading gmp -> 6.2.0 
==> Downloading https://homebrew.bintray.com/bottles/gmp-6.2.0.catalina.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/2e/2e6acd6e62d1b8ef0800061e113aea30a63f56b32b99c010234c0420fd6d3ecf?__gda__=exp=1586003712~hmac=1a3ede8872bae9e8bd6b238be3e7c56d1cc64a5b770646c6ffe342d6da269809&response-content-disposition=attachment%3Bfilename%3D%22gmp-6.2.0.catalina.bottle.tar.gz%22&response-content-type=application%2Fgzip&requ
######################################################################## 100.0%
==> Pouring gmp-6.2.0.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/gmp/6.2.0: 20 files, 3.2MB
Removing: /usr/local/Cellar/gmp/6.1.2_2... (18 files, 3.1MB)

見てみたら先程のディレクトリにもちゃんとファイルができた。

$ ls /usr/local/opt/gmp/lib/
libgmp.10.dylib		libgmp.a		libgmp.dylib		libgmpxx.4.dylib	libgmpxx.a		libgmpxx.dylib		pkgconfig

再度Rubyをインストール

$ rbenv install 2.7.1
Downloading ruby-2.7.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.1.tar.bz2
Installing ruby-2.7.1...
ruby-build: using readline from homebrew
Installed ruby-2.7.1 to /Users/niwatako/.anyenv/envs/rbenv/versions/2.7.1

成功。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?