当我尝试运行rails console
时,出现以下错误:
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)
我通过快速搜索找到了这篇帖子,我尝试了几个方法:
brew reinstall postgresql
(这确实是该项目的数据库)
以及
cd /usr/local/opt/readline/lib
ln libreadline.8.0.dylib libreadline.6.2.dylib
(我的readline版本是8)
尝试了以下方法,但都没有解决问题:
brew install readline
gem pristine --all
brew link readline --force
我最近向我的项目中添加了 pry-coolline
、guard
和 guard-livereload
宝石,不知道是否有影响(在添加这些之前,rails console一直能正常加载)。我正在最新的macOS上运行。
(更新) 我正在使用 pry rails 作为我的 rails console,不知道是否有影响。
请问有什么帮助的方法吗?谢谢。
brew reinstall readline
- MrYoshiji