Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/60.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 未初始化常量ActiveMerchant::Billing::CreditCard::Validatable(NameError)-在Spree shop中_Ruby On Rails_Deployment_Capistrano_Activemerchant - Fatal编程技术网

Ruby on rails 未初始化常量ActiveMerchant::Billing::CreditCard::Validatable(NameError)-在Spree shop中

Ruby on rails 未初始化常量ActiveMerchant::Billing::CreditCard::Validatable(NameError)-在Spree shop中,ruby-on-rails,deployment,capistrano,activemerchant,Ruby On Rails,Deployment,Capistrano,Activemerchant,我是rails的新手。今天我尝试将我的商店(SpreeShop)部署到新的生产服务器上,但出现了一些问题。我对一些gem有个愚蠢的问题:activemerchant(1.34.1) 下面是我的堆栈跟踪 uninitialized constant ActiveMerchant::Billing::CreditCard::Validateable (NameError) /home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/activemerchant-1.34

我是rails的新手。今天我尝试将我的商店(SpreeShop)部署到新的生产服务器上,但出现了一些问题。我对一些gem有个愚蠢的问题:activemerchant(1.34.1)

下面是我的堆栈跟踪

uninitialized constant ActiveMerchant::Billing::CreditCard::Validateable (NameError)
  /home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/activemerchant-1.34.1/lib/active_merchant/billing/credit_card.rb:51:in `<class:CreditCard>'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/activemerchant-1.34.1/lib/active_merchant/billing/credit_card.rb:49:in `<module:Billing>'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/activemerchant-1.34.1/lib/active_merchant/billing/credit_card.rb:6:in `<module:ActiveMerchant>'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/activemerchant-1.34.1/lib/active_merchant/billing/credit_card.rb:5:in `<top (required)>'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/activemerchant-1.34.1/lib/active_merchant/billing.rb:5:in `<top (required)>'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/activemerchant-1.34.1/lib/active_merchant.rb:56:in `<top (required)>'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@dp/bundler/gems/spree-3a3652adb1e8/core/lib/spree/core.rb:8:in `<top (required)>'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@dp/bundler/gems/spree-3a3652adb1e8/core/lib/spree_core.rb:1:in `require'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@dp/bundler/gems/spree-3a3652adb1e8/core/lib/spree_core.rb:1:in `<top (required)>'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@dp/bundler/gems/spree-3a3652adb1e8/lib/spree.rb:1:in `require'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@dp/bundler/gems/spree-3a3652adb1e8/lib/spree.rb:1:in `<top (required)>'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
  /home/dp/dp/releases/20150607162220/config/application.rb:7:in `<top (required)>'
  /home/dp/dp/releases/20150607162220/config/environment.rb:2:in `require'
  /home/dp/dp/releases/20150607162220/config/environment.rb:2:in `<top (required)>'
  config.ru:3:in `require'
  config.ru:3:in `block in <main>'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
  config.ru:1:in `new'
  config.ru:1:in `<main>'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@quiselle/gems/passenger-4.0.26/helper-scripts/rack-preloader.rb:105:in `eval'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/passenger-4.0.26/helper-scripts/rack-preloader.rb:105:in `preload_app'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/passenger-4.0.26/helper-scripts/rack-preloader.rb:150:in `<module:App>'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/passenger-4.0.26/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
  /home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/passenger-4.0.26/helper-scripts/rack-preloader.rb:28:in `<main>'
未初始化常量ActiveMerchant::Billing::CreditCard::Validatable(NameError)
/home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/activemerchant-1.34.1/lib/active\u-merchant/billing/credit\u-card.rb:51:in`'
/home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/activemerchant-1.34.1/lib/active\u-merchant/billing/credit\u-card.rb:49:in`'
/home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/activemerchant-1.34.1/lib/active\u-merchant/billing/credit\u-card.rb:6:in`'
/home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/activemerchant-1.34.1/lib/active\u-merchant/billing/credit\u-card.rb:5:in`'
/home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/activemerchant-1.34.1/lib/active\u-merchant/billing.rb:5:in`'
/home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/activemerchant-1.34.1/lib/active\u-merchant.rb:56:in`'
/home/dp/.rvm/gems/ruby-1.9.3-p429@dp/bundler/gems/spree-3a3652adb1e8/core/lib/spree/core.rb:8:in`'
/home/dp/.rvm/gems/ruby-1.9.3-p429@dp/bundler/gems/spree-3a3652adb1e8/core/lib/spree_core.rb:1:in'require'
/home/dp/.rvm/gems/ruby-1.9.3-p429@dp/bundler/gems/spree-3a3652adb1e8/core/lib/spree_core.rb:1:in`'
/home/dp/.rvm/gems/ruby-1.9.3-p429@dp/bundler/gems/spree-3a3652adb1e8/lib/spree.rb:1:in'require'
/home/dp/.rvm/gems/ruby-1.9.3-p429@dp/bundler/gems/spree-3a3652adb1e8/lib/spree.rb:1:in`'
/home/dp/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in'require'
/home/dp/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in'block(2层)in require'
/home/dp/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in'each'
/home/dp/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in'block in require'
/home/dp/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in'each'
/home/dp/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in'require'
/home/dp/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler.rb:132:in'require'
/home/dp/dp/releases/20150607162220/config/application.rb:7:in`'
/home/dp/dp/releases/20150607162220/config/environment.rb:2:in'require'
/home/dp/dp/releases/20150607162220/config/environment.rb:2:in`'
config.ru:3:in'require'
config.ru:3:in'block in'
/home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/rack-1.4.5/lib/rack/builder.rb:51:in'instance_eval'
/home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/rack-1.4.5/lib/rack/builder.rb:51:in'initialize'
config.ru:1:in'new'
config.ru:1:in`'
/home/dp/.rvm/gems/ruby-1.9.3-p429@quiselle/gems/passenger-4.0.26/helper scripts/rack preload.rb:105:in'eval'
/home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/passenger-4.0.26/helper scripts/rack preload.rb:105:in'preload_app'
/home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/passenger-4.0.26/helper脚本/rack-preload.rb:150:in`'
/home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/passenger-4.0.26/helper脚本/rack-preload.rb:29:in`'
/home/dp/.rvm/gems/ruby-1.9.3-p429@dp/gems/passenger-4.0.26/helper脚本/rack-preload.rb:28:in`'

你知道如何解决这个问题吗???我在另一篇文章中看到了类似的问题,但没有什么是没有帮助的……

这是同一个问题,详细内容见

该问题的修复程序已包含在activemerchant版本
1.47.0
或更高版本中,并在其中提供

因此,要解决rails应用程序上的问题,请更新activemerchant gem版本。步骤如下:

  • 修改
    Gemfile
    并使用
    gem'activemerchant',1.50.0'
  • 运行
    bundle安装
  • 可以使用高于
    1.47.0
    的任何版本的activemerchant gem

    更新
    gem不依赖于任何特定版本的
    activemerchant
    。运行
    bundle update
    以强制其使用最新版本的
    activemerchant
    gem。

    未初始化的常量activemerchant::Billing::CreditCard::Validatable问题与
    active\u utils的版本有关。版本3抛出错误;版本2没有。您需要在gem文件中设置gem版本

    # Gemfile
    gem 'active_utils',  '2.0.2'
    gem 'activemerchant', '~> 1.32.1', require: 'active_merchant'
    
    好的,但我使用的是来自的宝石:,你认为我的宝石有什么问题吗?