When I try running rails console
I get this error:
/Users/TuzsNewMacBook/.rvm/gems/ruby-2.3.7/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require':
dlopen(/Users/TuzsNewMacBook/.rvm/rubies/ruby-2.3.7/lib/ruby/2.3.0/x86_64-darwin18/readline.bundle, 9):
Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib (LoadError)
A quick search got me to this post and I've tried a few things:
brew reinstall postgresql
(this is indeed the DB for this project)
and
cd /usr/local/opt/readline/lib
ln libreadline.8.0.dylib libreadline.6.2.dylib
(my version of readline is 8)
and
brew link readline --force
But none of these have fixed it.
I recently added pry-coolline
, guard
and guard-livereload
gems to my project if that makes any difference (rails console loaded fine before those). I'm running on the latest macos.
(Update) I’m using pry rails as my rails console, if that makes any difference.
Any help? Thanks.
the error seems to be thrown when searching for /usr/local/opt/readline/lib/libreadline.7.dylib
.
Have you tried to symlink that?
So something like:
cd /usr/local/opt/readline/lib
ln -s libreadline.8.0.dylib libreadline.7.dylib
Just tried that on macOS Mojave, ruby 2.5.3p105 and Rails 5.2.2 and worked.
Reinstalling my Ruby version seems to have fixed it:
rvm reinstall 2.3.7
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With