[RUBY] What to do when rbenv says that there is no readline or lib history

environment

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

After brew install rbenv, an error occurred when checking the version or 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

I have confirmed that readline is installed by homebrew with dependency resolution.

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

It seems that it can be solved by making a symbolic link from libreadline.6.dylib to 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

The readline error is gone, but libhistory seems to need the same thing.

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

$ rbenv -v
rbenv 1.1.2

solved.

Recommended Posts

What to do when rbenv says that there is no readline or lib history
What to do when you want to delete a migration file that is "NO FILE"
ParseException: What to do when Unparseable date is reached
[Rails] What to do when rails db: migrate cannot be done because there is no table referenced by the foreign key
[Rails] What to do when rails s does not respond or does not stop
java.security.InvalidKeyException: What to do when Illegal key size or default parameters
What to do when javax.batch.operations.JobStartException occurs
What to do if zip dies if there is a pom when making an executable jar with gradle
[IOS] What to do when the image is filled with one color
What to do when "npm ERR! Code ENOSELF" is displayed after npm install
Notes on what to do when EC2 is set up with t2.micro
What to do if tomcat process remains when tomcat is stopped in eclipse
What to do when a javax.el.PropertyNotWritableException occurs
What to do when undefined method ʻuser_signed_in?'
gradle's mybatis-generator-plugin says there is no MapperAnnotationPlugin
What to do if you are told "there is no main manifest attribute" when creating a jar file containing dependencies in a maven project
What to do when is invalid because it does not start with a'-'
What to do when debugging "Source not found"
What do you use when converting to String?
What to do when IllegalStateException occurs in PlayFramework
After installing'devise''bootstrap' of gemfile with rails, what to do when url is an error
What to do when "Fail to load the JNI shared library" is displayed in Eclipse
What to do when build fails by rbenv install / pyenv install with anyenv (Debian system)
What to do when Address already in use is displayed after executing rails s
What to do if Android Studio says "your CPU doesn't support vt-x or svm"
What to do when JSF tags do not become HTML
What to do when a null byte error occurs
What to do when rails creates a 〇〇 2.rb file
Error ExecJS :: RuntimeUnavailable: What to do when it occurs
[Joke] What to do when the invalid sample rate is reached when using Mixxx on Ubuntu 20.04
[Rails] What to do when the view collapses when a message is displayed with the errors method