【问题标题】:Ruby command line errorRuby 命令行错误
【发布时间】:2014-07-10 02:34:33
【问题描述】:

您好,我是所有这些编程的新手。尝试通过 Odin 项目学习。他们让我在命令行上使用命令“rake”进行测试。我安装了 ruby​​ 版本 2.1.2 并安装了 rspec。无论如何,我在尝试运行命令“rake”时收到此错误。

Joel-Prestons-MacBook-Air-4:00_hello joelpreston$ rake
(in /Users/joelpreston/learnRuby/learn_ruby)
rake aborted!
Gem::LoadError: can't activate rspec (~> 2), already activated rspec-3.0.0. Make sure all dependencies are added to Gemfile.
/Users/joelpreston/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/rubygems_integration.rb:262:in `block in replace_gem'
/Users/joelpreston/learnRuby/learn_ruby/Rakefile:2:in `<top (required)>'
/Users/joelpreston/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
/Users/joelpreston/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)
Joel-Prestons-MacBook-Air-4:00_hello joelpreston$ 

谁能解释我需要做什么才能让 rake 运行?提前致谢。乔尔

【问题讨论】:

    标签: osx-mavericks


    【解决方案1】:

    我也有同样的问题。我遇到了这个解决方案,

    安装低于 3.0.0 的 rspec 版本。

    sudo gem install -v '< 3.0.0' rspec
    

    我不确定这是长期解决方案,但它确实对我有用。

    我在 Jayson Virissimo 的帖子中找到了它: Rake aborted: could not find rspec

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-04-30
      • 1970-01-01
      • 1970-01-01
      • 2022-07-13
      • 1970-01-01
      • 1970-01-01
      • 2021-01-18
      相关资源
      最近更新 更多