1

我有一个新的 Rails 安装,当我尝试运行控制台或任何 rake 任务时,我收到一条如下所示的错误消息:

$ rails c
[/.rvm/gems/ruby-1.9.2-p320/specifications/json_pure-1.7.0.gemspec] isn't a Gem::Specification (NilClass instead).
[/.rvm/gems/ruby-1.9.2-p320/specifications/engineyard-1.4.29.gemspec] isn't a Gem::Specification (NilClass instead).
[/.rvm/gems/ruby-1.9.2-p320/specifications/launchy-2.0.5.gemspec] isn't a Gem::Specification (NilClass instead).
[/.rvm/gems/ruby-1.9.2-p320/specifications/engineyard-serverside-adapter-1.6.4.gemspec] isn't a Gem::Specification (NilClass instead).
[/.rvm/gems/ruby-1.9.2-p320/specifications/escape-0.0.4.gemspec] isn't a Gem::Specification (NilClass instead).
[/.rvm/gems/ruby-1.9.2-p320/specifications/highline-1.6.11.gemspec] isn't a Gem::Specification (NilClass instead).
[/.rvm/gems/ruby-1.9.2-p320/specifications/net-ssh-2.2.2.gemspec] isn't a Gem::Specification (NilClass instead).
[/.rvm/gems/ruby-1.9.2-p320/specifications/json_pure-1.7.0.gemspec] isn't a Gem::Specification (NilClass instead).
[/.rvm/gems/ruby-1.9.2-p320/specifications/engineyard-1.4.29.gemspec] isn't a Gem::Specification (NilClass instead).
[/.rvm/gems/ruby-1.9.2-p320/specifications/launchy-2.0.5.gemspec] isn't a Gem::Specification (NilClass instead).
[/.rvm/gems/ruby-1.9.2-p320/specifications/engineyard-serverside-adapter-1.6.4.gemspec] isn't a Gem::Specification (NilClass instead).
[/.rvm/gems/ruby-1.9.2-p320/specifications/escape-0.0.4.gemspec] isn't a Gem::Specification (NilClass instead).
[/.rvm/gems/ruby-1.9.2-p320/specifications/highline-1.6.11.gemspec] isn't a Gem::Specification (NilClass instead).
[/.rvm/gems/ruby-1.9.2-p320/specifications/net-ssh-2.2.2.gemspec] isn't a Gem::Specification (NilClass instead).
[/.rvm/gems/ruby-1.9.2-p320/specifications/json_pure-1.7.0.gemspec] isn't a Gem::Specification (NilClss instead).
[/.rvm/gems/ruby-1.9.2-p320/specifications/engineyard-1.4.29.gemspec] isn't a Gem::Specification (Nillass instead).
[/.rvm/gems/ruby-1.9.2-p320/specifications/launchy-2.0.5.gemspec] isn't a Gem::Specification (NilClas instead).
[/.rvm/gems/ruby-1.9.2-p320/specifications/engineyard-serverside-adapter-1.6.4.gemspec] isn't a Gem::pecification (NilClass instead).
[/.rvm/gems/ruby-1.9.2-p320/specifications/escape-0.0.4.gemspec] isn't a Gem::Specification (NilClassinstead).
[/.rvm/gems/ruby-1.9.2-p320/specifications/highline-1.6.11.gemspec] isn't a Gem::Specification (NilClss instead).
[/.rvm/gems/ruby-1.9.2-p320/specifications/net-ssh-2.2.2.gemspec] isn't a Gem::Specification (NilClas instead).
/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/irb/completion.rb:9:in `require': no such file to load --readline (LoadError)
        from /.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/irb/completion.rb:9:in `<top (required)>'
        from /.rvm/gems/ruby-1.9.2-p320/gems/railties-3.0.4/lib/rails/commands/console.rb:3:in `requie'
        from /.rvm/gems/ruby-1.9.2-p320/gems/railties-3.0.4/lib/rails/commands/console.rb:3:in `<top required)>'
        from /.rvm/gems/ruby-1.9.2-p320/gems/railties-3.0.4/lib/rails/commands.rb:20:in `require'
        from /.rvm/gems/ruby-1.9.2-p320/gems/railties-3.0.4/lib/rails/commands.rb:20:in `<top (requird)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'

有什么想法可能导致这种情况吗?

谢谢。

4

1 回答 1

0

我认为它是 readline

/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/irb/completion.rb:9:in `require': 没有要加载的文件 --readline (LoadError)

这里有一些资源:

https://rvm.io//packages/readline/

rails 控制台、RVM 和 readline 的问题

如果上述方法对您不起作用,那么您可以执行我所做的并在此处使用解决方案:

Rails3 和 readline 问题

这是在您的项目中包含 rb-readline gem。(我不确定这是否被认为是黑客攻击)

https://github.com/luislavena/rb-readline

希望有帮助。我花了一段时间才让控制台工作一次,而且有时令人沮丧。更不用说在更新了一些 Ubuntu 软件包后我不得不再次这样做。

于 2012-06-02T02:26:44.233 回答