Cannot execute "rails console" due to an error with readline
I had the same issue recently with homebrew and libreadline.7.x.dylib / libreadline.6.x.dylib
I solved it by running:
ln -s /usr/local/opt/readline/lib/libreadline.7.0.dylib /usr/local/opt/readline/lib/libreadline.6.dylib
Homebrew is great, but once in a while it doesn't play nice with some of the other moving parts.
A brew update && brew upgrade
brought in libreadline.7.x.dylib
while automatically removing libreadline.6.x.dylib
, which ruby was still relying on.
There may be more clever ways to fix the problem, but brute force worked for me:
$ rbenv uninstall 2.3.1$ rbenv install 2.3.1$ cd /path/to/my/app$ bundle
The above assumes the presence of rbenv's ruby-build
and, of course, bundler
; replace 2.3.1
with whatever version of ruby you are using.
Please note that similar problems can occur with different homebrew-managed libraries (see my own answer to this, for example)
I'm on OSX, ruby2.3.0, rails5. Adding gem 'rb-readline'
to my Gemfile
fixed this problem.