当放弃使用 rspec 和 rspec-rails 插件并改用 gem 版本时,我是否需要在 spec_helper.rb 中进行任何额外的更改,或者让我的应用程序中的规范看到更改?
删除插件并安装 gem (1.1.8) 后,我无法再让我的规范成功运行。
更具体地说,这就是我所做的:
- 从供应商目录中删除以前安装的 rspec 和 rspec-rails 插件
- sudo 安装了 rspec 和 rspec-rails gems(1.1.8 是撰写本文时的最新版本)
运行脚本/autospec 时,我收到以下消息:
/Library/Ruby/Site/1.8/rubygems.rb:578:in
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
activate' 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/dependencies.rb:509:inrequire' 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/dependencies.rb:509:inrequire' from /Volumes/tangoflash/code/tangoflash/spec/spec_helper.rb:5 from spec/helpers/sessions_helper_spec.rb:1:in
来自 spec/helpers/sessions_helper_spec.rb:1
尝试通过 textmate 运行单个 rspec 示例时,我得到:
/Library/Ruby/Site/1.8/rubygems.rb:578:in
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
activate' 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
来自 /Users/allanlibunao/Library/Application Support/TextMate/Bundles/RSpec.tmbundle/Support/lib/spec/mate.rb:14 来自 /tmp/temp_textmate.KQTYKh:3:in `require'来自 /tmp/temp_textmate.KQTYKh:3
任何帮助都是极好的。