Rake中止:无法找到rspec [英] Rake aborted: could not find rspec

查看:118
本文介绍了Rake中止:无法找到rspec的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过TestFirst.org的Ruby课程。它要求您导航到包含练习的文件夹,运行rake,然后更正它揭示的源代码中的任何错误。当我在第一个练习的文件夹中运行rake时,会出现此错误:

I'm trying to work through the Ruby course from TestFirst.org. It requires you to navigate to the folder containing the exercise, run rake, and then correct any errors in the source code it uncovers. When I run rake in the folder for the first exercise it gives this error:

rake aborted!
Could not find rspec (~> 2) amongst [diff-lcs-1.2.5, rspec-3.0.0, rspec-core-3.0.0,
rspec- expectations-3.0.0, rspec-mocks-3.0.1, rspec-support-3.0.0]
/home/jayson/Desktop/learn_ruby/Rakefile:2:in `<top (required)>'
(See full trace by running task with --trace)

这是否意味着它只能用于旧版本rspec或其他东西?使用--trace运行rake给了我:

Does this means it will only work with an old version of rspec or something else? Running rake with --trace gives me:

rake aborted!
Could not find rspec (~> 2) amongst [diff-lcs-1.2.5, rspec-3.0.0, 
rspec-core-3.0.0, rspec-expectations-3.0.0, rspec-mocks-3.0.1, rspec-support-3.0.0]
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs'
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
/usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
/home/jayson/Desktop/learn_ruby/Rakefile:2:in `<top (required)>'
/usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load'
/usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:589:in `raw_load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:89:in `block in load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:160:in `standard_exception_handling'
/usr/lib/ruby/vendor_ruby/rake/application.rb:88:in `load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:72:in `block in run'
/usr/lib/ruby/vendor_ruby/rake/application.rb:160:in `standard_exception_handling'
/usr/lib/ruby/vendor_ruby/rake/application.rb:70:in `run'
/usr/bin/rake:27:in `<main>'

如何让rake命令正常工作?我在Ubuntu 14.04中使用Terminal,包括Ruby 1.9.3,RubyGems 1,8.23和Rspec 3.0.0。

How do I get the rake command to work properly? I'm using Terminal in Ubuntu 14.04, with Ruby 1.9.3, RubyGems 1,8.23, and Rspec 3.0.0. Thanks in advance.

推荐答案

我有同样的问题,并且 sudo gem install -v'< 3.0.0'rspec 确实有效,但是只有在我使用 gem uninstall rspec 卸载新版本后才有效。

I had the same problem, and sudo gem install -v '<3.0.0' rspec did work, but only after I uninstalled the newer version with gem uninstall rspec.

如果没有先卸载,只有更新版本保持活动状态,问题将会持续。

Without that uninstall first, only the later version remains active and the problem will continue.

这篇关于Rake中止:无法找到rspec的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆