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 3 years have passed since last update.

rbenvにてreadline, libhistoryがないと言われたときの対処

Posted at

環境

macOS Catalina 10.15.4
rbenv
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]

brew install rbenv の後、バージョン確認や rbenv init した際にエラーが出た。

$ rbenv -v
dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib
  Referenced from: /usr/local/bin/bash
  Reason: image not found
Abort trap: 6

readlineはhomebrewで依存関係解決でインストールされているのを確認済みだ。

$ ls /usr/local/opt/readline/lib/
libhistory.8.0.dylib   libhistory.a           libreadline.8.0.dylib  libreadline.a          pkgconfig/
libhistory.8.dylib@    libhistory.dylib@      libreadline.8.dylib@   libreadline.dylib@

libreadline.6.dylib から libhistory.dylib にシンボリックリンクを張って解決できそうなので

$ ln -s /usr/local/opt/readline/lib/libreadline.dylib /usr/local/opt/readline/lib/libreadline.6.dylib

$ ls /usr/local/opt/readline/lib/
libhistory.8.0.dylib   libhistory.a           libreadline.6.dylib@   libreadline.8.dylib@   libreadline.dylib@
libhistory.8.dylib@    libhistory.dylib@      libreadline.8.0.dylib  libreadline.a          pkgconfig/

$ rbenv -v
dyld: Library not loaded: /usr/local/opt/readline/lib/libhistory.6.dylib
  Referenced from: /usr/local/bin/bash
  Reason: image not found
Abort trap: 6

readlineのエラーがでなくなったがlibhistoryでも同じことが必要っぽいので

$ ln -s /usr/local/opt/readline/lib/libhistory.dylib /usr/local/opt/readline/lib/libhistory.6.dylib

$ rbenv -v
rbenv 1.1.2

解決しました。

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?