当我尝试在 3.1 中加载 Rails 控制台时出错
当我尝试在 3.1 中加载 Rails 控制台时,出现以下错误。为什么我会得到这个?我做错了什么吗?
/home/brettlee/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/completion.rb:9:in `require': no such file to load -- readline (LoadError)
from /home/brettlee/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/completion.rb:9:in `<top (required)>'
from /home/brettlee/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/commands/console.rb:3:in `require'
from /home/brettlee/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/commands/console.rb:3:in `<top (required)>'
from /home/brettlee/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/commands.rb:37:in `require'
from /home/brettlee/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/commands.rb:37:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I get the following error when i try to load the rails console in 3.1. why do i get this? am i doing something wrong?
/home/brettlee/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/completion.rb:9:in `require': no such file to load -- readline (LoadError)
from /home/brettlee/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/completion.rb:9:in `<top (required)>'
from /home/brettlee/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/commands/console.rb:3:in `require'
from /home/brettlee/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/commands/console.rb:3:in `<top (required)>'
from /home/brettlee/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/commands.rb:37:in `require'
from /home/brettlee/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/commands.rb:37:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编辑:布莱恩是对的 - 只需尝试安装 libncurses &首先是 libreadline,它很有可能自行工作。如果这不起作用,您可能需要重新安装整个 ruby。
非常常见的错误 - 这意味着您缺少一些运行控制台所需的库。
本指南应该向您展示如何修复它。
缺点是,尝试安装 libncurses & readline 使用以下命令(我从你的目录结构猜测你正在使用 Ubuntu。如果它是其他不使用 apt-get 的东西,请进行相应更改)
如果这不起作用,你需要重新安装 ruby 1.9.2 安装readline包后通过rvm。不过,不要卸载通过 apt-get 安装的 libncurses/readline 软件包 - 你仍然需要它们。
希望这有帮助
EDIT: Bryan is right - just try installing libncurses & libreadline first, there's a good chance that'll work by itself. If that doesn't fly, you might need to do the whole ruby reinstall thing.
Really common error - it means you're missing some libraries necessary to run console.
This guide should show you how to fix it.
The short of it is, try installing libncurses & readline with the following command (I'm guessing from your directory structure you're using Ubuntu. If it's something else that doesn't use apt-get, change accordingy)
If that doesn't work, you'll need to reinstall ruby 1.9.2 through rvm after installing the readline package. Don't uninstall the libncurses/readline packages installed through apt-get though - you'll still need 'em.
Hope this helps