rails console在rails 3.2.1中不起作用

时间:2012-04-20 11:44:07

标签: ruby-on-rails ruby-on-rails-3.1

我正在使用rails 3.2.1的rails应用程序。我为它创建了一个单独的宝石套装并安装了宝石。到目前为止,每件事情都运行良好,但是当我去rails console时,我收到以下错误:

/home/santosh/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/completion.rbin require': no such file to load -- readline (LoadError)
from /home/santosh/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/completion.rb:9:in'
from /home/santosh/.rvm/gems/ruby-1.9.2-p290@sample/gems/railties-3.2.1/lib/rails/commands/console.rbin require'
from /home/santosh/.rvm/gems/ruby-1.9.2-p290@sample/gems/railties-3.2.1/lib/rails/commands/console.rb:3:in'
from /home/santosh/.rvm/gems/ruby-1.9.2-p290@sample/gems/railties-3.2.1/lib/rails/commands.rb:38:in require'
from /home/santosh/.rvm/gems/ruby-1.9.2-p290@sample/gems/railties-3.2.1/lib/rails/commands.rb:38:in'
from script/railsin require'
from script/rails:6:in'

通过谷歌浏览并尝试安装readline但没有用。那我在哪里做错了?

1 个答案:

答案 0 :(得分:0)

由于使用rvm进行ruby安装,我遇到了类似的问题。

要解决此问题,我卸载了我的ruby版本,并使用此命令对其进行了安装:

rvm install 1.9.2 --with-readline-dir=$rvm_path/.rvm/usr

我希望它有所帮助