/Users/parkerharris/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/completion.rb:10:in `require': dlopen(/Users/parkerharris/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib (LoadError)
Referenced from: /Users/parkerharris/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle
Reason: image not found - /Users/parkerharris/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle
from /Users/parkerharris/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/irb/completion.rb:10:in `<top (required)>'
from /Users/parkerharris/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/console.rb:3:in `require'
from /Users/parkerharris/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/console.rb:3:in `<top (required)>'
from /Users/parkerharris/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:138:in `require'
from /Users/parkerharris/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:138:in `require_command!'
from /Users/parkerharris/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:68:in `console'
from /Users/parkerharris/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /Users/parkerharris/.rvm/gems/ruby-2.3.0/gems/railties-5.0.0.1/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
尝试执行命令后,这是我的错误屏幕。我试图卸载并重新安装readline,但没有帮助。我只是在学习rails并且不会100%知道我在做什么(只是按照指南)所以这种类型的错误超出了我的理解。谢谢!
答案 0 :(得分:15)
可能不相关,但我今天也遇到了同样的事情。
今天早上我有一个功能齐全的Ruby 2.3.1工作正常。就我而言,Ruby是由ruby-build编译和安装的,由rbenv管理。
今天有一次我用
更新了Homebrewterraform
其中一个升级的公式是readline 7.0:
brew cleanup --prune=30
brew update
brew upgrade
不久之后,我发现我对Ruby的readline支持已经彻底破解了。我看到了和你一样的错误:
$ brew info readline
...
/usr/local/Cellar/readline/7.0 (45 files, 2M)
Poured from bottle on 2016-10-05 at 08:09:22
解决方案是完全删除我的Ruby安装并重新编译它:
/Users/mbrictson/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.4/lib/pry/config/default.rb:151:in `require': dlopen(/Users/mbrictson/.rbenv/versions/2.3.1/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle, 9): Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib (LoadError)
Referenced from: /Users/mbrictson/.rbenv/versions/2.3.1/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle
Reason: image not found - /Users/mbrictson/.rbenv/versions/2.3.1/lib/ruby/2.3.0/x86_64-darwin15/readline.bundle
from /Users/mbrictson/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.10.4/lib/pry/config/default.rb:151:in `lazy_readline'
我知道你使用的是rvm而不是rbenv,但也许你的情况下的解决方案是类似的:删除你的Ruby安装并使用rvm重新安装它。
答案 1 :(得分:8)
一个非常快速和快速的解决方案是将rb-readline添加到您的Gemfile中。 (如果其他解决方案不起作用,你想继续前进,直到你有时间解决这个问题。我知道这不是理想的,但它是一个有效的解决方案。)
在GemFile中:
group :development do
gem 'rb-readline'
end
现在,只需捆绑安装。我在选项4上找到了这个解决方案 (https://github.com/guard/guard/wiki/Add-Readline-support-to-Ruby-on-Mac-OS-X) 我希望它有所帮助。
答案 2 :(得分:1)
您的rvm
出现了问题,似乎与rails无关。请确认它是否安装正确。
确保您已在https://rvm.io/rvm/prerequisites
上检查了rvm先决条件并且您的安装工作正常,例如
(来自:https://rvm.io/rvm/install) 如果安装和配置成功,则无论何时打开新shell,都应加载RVM。这可以通过执行以下命令来测试,该命令应输出rvm是如下所示的函数。
$ type rvm | head -n 1
rvm is a function
检查你的mac是否已正确编译readline
,或者尝试再次安装ruby-2.3.0
答案 3 :(得分:1)
我有类似的问题。我的Ruby是使用HomeBrew安装的。在我的情况下,我需要卸载Ruby;安装/链接libyaml;然后重新安装ruby。
{{1}}
答案 4 :(得分:0)
当我在安装ruby 2.3.1后无意中运行rvm requirements
时,发生了同样的事情。
rvm uninstall 2.3.1
rvm install 2.3.1
上面修正了它。
答案 5 :(得分:0)
从命令行运行它对我有用:
ln -s /usr/local/opt/readline/lib/libreadline.7.0.dylib /usr/local/opt/readline/lib/libreadline.6.dylib
来自github