Rails控制台无法正常工作 - rails c

时间:2014-04-10 18:21:32

标签: ruby-on-rails ruby

我已经重新安装了Ruby版本,但我无法找到原因,当我转到终端并输入rails c时,它会抛出此错误:

.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/completion.rb:9:in `require': cannot load such file -- readline (LoadError)
from /Users/cleytonmessias/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/completion.rb:9:in `<top (required)>'
from /Users/cleytonmessias/.rvm/gems/ruby-2.0.0-p247@trustvox/gems/railties-4.0.3/lib/rails/commands/console.rb:3:in `require'
from /Users/cleytonmessias/.rvm/gems/ruby-2.0.0-p247@trustvox/gems/railties-4.0.3/lib/rails/commands/console.rb:3:in `<top (required)>'
from /Users/cleytonmessias/.rvm/gems/ruby-2.0.0-p247@trustvox/gems/railties-4.0.3/lib/rails/commands.rb:51:in `require'
from /Users/cleytonmessias/.rvm/gems/ruby-2.0.0-p247@trustvox/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>'

我使用的是Mac OSX Mavericks,Ruby-2.0.0-p247和Rails 4。

1 个答案:

答案 0 :(得分:0)

我终于找到了一个帮助我的参考资料。

使用此link

  • brew install readline
  • brew link readline
  • 我转到了文件~/.rvm/user/db并添加了以下行:ruby_configure_flags=--with-readline-dir=/usr/local/opt/readline
  • rvm重新安装2.0.0-p247 --with-openssl-dir = / usr / local

现在,当我输入rails c时,它再次工作:)