我正在尝试运行rails console
。我已经尝试了所有建议的SO。我安装了libreadline-6
。我的ruby版本是2.1.1,irb是0.9.6。
/home/xamroc/.rbenv/versions/2.1.1/lib/ruby/2.1.0/irb/completion.rb:9:in `require': cannot load such file -- readline (LoadError)
from /home/xamroc/.rbenv/versions/2.1.1/lib/ruby/2.1.0/irb/completion.rb:9:in `<top (required)>'
from /home/xamroc/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/commands/console.rb:3:in `require'
from /home/xamroc/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/commands/console.rb:3:in `<top (required)>'
from /home/xamroc/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/commands.rb:51:in `require'
from /home/xamroc/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/commands.rb:51:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
有什么建议吗?
另外,我使用rbenv来管理我的ruby版本。
答案 0 :(得分:1)
您需要安装libreadline和-dev包,然后需要重新编译ruby。当你使用rvm时,你应该总是运行
rvm requirements
首先下载并编译ruby。如果您使用rvm,那么您可以运行
rvm reinstall <version>
这样做。
//另见:http://vvv.tobiassjosten.net/ruby/readline-in-ruby-with-rbenv/