Lee*_*fin 0 rspec ruby-on-rails rspec2 ruby-on-rails-3 ruby-on-rails-3.1
我正在开发一个Rails v2.3应用程序.
当我通过执行命令运行rspec测试时:
rspec spec/controllers/my_controller_spec.rb
我收到了以下错误消息:
/.rvm/gems/ruby-1.8.7-p352@myapp/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:427:in `raise_if_rspec_1_is_loaded': (RuntimeError)
********************************************************************************
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.
********************************************************************************
/.rvm/gems/ruby-1.8.7-p352@myapp/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:420:in `load_spec_files'
Run Code Online (Sandbox Code Playgroud)
----更新---
因为它抱怨一些包含代码的文件require 'spec',所以我按照这个线索,我require 'spec'在spec/spec_helper.rb中找到" " ,但是,在我删除它之后,同样的错误仍然会升起,我没有任何其他文件现在包含代码.
为什么错误仍然存在,那么真正的原因是什么呢?
rspec是可执行文件rspec-2.spec是可执行文件rspec-1.rspec-2与...不兼容rails 2.3.你的命令应该是:
spec spec/controllers/my_controller_spec.rb
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
458 次 |
| 最近记录: |