Rspec显示错误的版本号

时间:2012-05-22 16:08:24

标签: ruby-on-rails ruby rspec

我在ruby 1.8.7和rvm下使用自定义gemset运行Rails 2.3.4应用程序。

在尝试启动和运行rspec时,我尝试了几次卸载rspec 2并安装rspec和rspec-rails版本1.3.4。但是,当我运行rspec -v时,无论我做什么,我都会得到2.10.0。

最后我收到了以下错误消息:

You are running rspec-2, but it seems as though rspec-1 has been loaded as
  well.  This is likely due to a statement like this somewhere in the specs:

      require 'spec'

  Please locate that statement, remove it, and try again.

所以看起来2.10.0实际上仍然被加载。即使我做了gem uninstall rspec rspec仍然加载。发生了什么事?

1 个答案:

答案 0 :(得分:2)

您应该使用spec(RSpec 1可执行文件)而不是rspec,如this answer中所述。