2

我正在尝试运行ActiveMerchantgem 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?

4

2 回答 2

0

gem 'activemerchant' # => Ruby 1.9.2 / AM 1.12.x

对比

gem 'active_merchant' # => ? / AM 1.5.2

于 2011-03-10T21:30:41.277 回答
0

ActiveMerchant 的版本是 1.12.0,所以 1.4.1 已经很老了——你用最新版本试过了吗?

于 2011-03-14T12:20:04.533 回答