我正在尝试运行ActiveMerchant
gem 1.4.1 版的单元测试:https://github.com/Shopify/active_merchant/tree/v1.4.1
首先我跑了: rake -T 并得到了错误:
uninitialized constant ActiveMerchant::Validateable::HashWithIndifferentAccess
我通过添加以下内容修复了第一个错误:
gem 'activesupport', "=2.3.4"
require 'active_support'
在 Rakefile 的顶部(https://github.com/Shopify/active_merchant/blob/v1.4.1/Rakefile
)。请注意,我必须指定确切的版本(我猜HashWithIndifferentAccess
在以后的版本中不存在ActiveSupport).
现在,如果我运行:rake test:units,我会得到同样的错误:
uninitialized constant ActiveMerchant::Validateable::HashWithIndifferentAccess
这是它尝试运行的任务(在同一个 Rakefile 中):
Rake::TestTask.new(:units) do |t|
t.pattern = 'test/unit/**/*_test.rb'
t.ruby_opts << '-rubygems'
t.verbose = true
end
我怎样才能摆脱这个错误?我是否需要在任务中指定 activesupport gem?