当放弃使用rspec和rspec rails插件并切换到gem版本时,我是否需要在spec_helper.rb中做任何额外的更改,或者做一些什么来让我的应用程序中的规范看到更改?
删除插件并安装gems(1.1.8)后,我再也无法成功运行我的规范了
更具体地说,这就是我所做的:
- 从供应商目录中删除以前安装的rspec和rspecrails插件
- sudo安装了rspec和rspecrails-gems(1.1.8是本文的最新版本)
当运行脚本/autospec时,我得到以下消息:
/Library/Ruby/Site/1.8/rubygems.rb:578:在
report_activate_error': RubyGem version error: hoe(1.5.0 not >= 1.7.0) (Gem::LoadError) from /Library/Ruby/Site/1.8/rubygems.rb:134:in
中激活'from/Library/Ruby/Site/1.8/rubygems.rb:158:inactivate' from /Library/Ruby/Site/1.8/rubygems.rb:157:in
each'from/Library/Ruby/Site/1.8/rubygems.rb:157:inactivate' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
require'来自/Library/Ruby/Gems/1.8/Gems/activesupport-2.1.0/lib/active_support/dependences.rb:509:在require' from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in
new_constants_in'中来自/Library/Ruby/Gems/1.8/Gems/activesupport-2.1.0/lib/active_support/dependences.rb:509:在require' from /Volumes/tangoflash/code/tangoflash/spec/spec_helper.rb:5 from spec/helpers/sessions_helper_spec.rb:1:in
中require'来自spec/helpers/sessions_helper_spec.rb:1
当试图通过textmate运行单个rspec示例时,我得到:
/Library/Ruby/Site/1.8/rubygems.rb:578:在
report_activate_error': RubyGem version error: hoe(1.5.0 not >= 1.7.0) (Gem::LoadError) from /Library/Ruby/Site/1.8/rubygems.rb:134:in
中从/Library/Ruby/Site/1.8/rubygms.rb:158:在activate' from /Library/Ruby/Site/1.8/rubygems.rb:157:in
中的每一个"从/Libraly/Ruby/Site/1.8/rubygems.rb:157:在activate' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
中需要"从/Users/allalibunao/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/mate.rb:14从/tmp/temp_TextMate.KQTYKh:3:在"需要"中从/tmp_temp_TextMate.KQTYKh:3
任何帮助都会很棒。
从您的错误消息来看,您似乎没有安装最新版本的hoe
gem。试着做一个gem install hoe --version '> 1.7.0
,看看它是否有帮助。可能是在安装rspec
和rspec-rails
gem时,您没有获得依赖项,并且可能缺少其他依赖项。