Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uninitialized constant ActiveMerchant::Billing::Integrations::Helper (NameError) #1357

Closed
ZhangHanDong opened this issue Aug 22, 2014 · 5 comments

Comments

@ZhangHanDong
Copy link

gem 'activemerchant', "~> 1.44.0", :require => 'active_merchant'

No such problem when i use version 1.43.3

@ntalbott
Copy link
Contributor

This is due to integrations being extracted to the offsite_payments gem, but we have a compatibility layer that should let it still work. Can you give me a full stack trace so I can try to figure out why the compatibility layer's not working?

@ZhangHanDong
Copy link
Author

Gemfile:

gem "activesupport", "~> 4.2.0.beta1"
gem "activerecord", "~> 4.2.0.beta1"

gem 'activemerchant', "~> 1.44.0", :require => 'active_merchant'

Gemfile.lock:

activemerchant (1.44.0)
      active_utils (~> 2.2.0)
      activesupport (>= 3.2.14, < 5.0.0)
      builder (>= 2.1.2, < 4.0.0)
      i18n (>= 0.6.9)
      json (~> 1.7)
      nokogiri (~> 1.4)
      offsite_payments (~> 2.0.0)

full stack trace:

/vagrant_data/apps/mobile-api/lib/payment/integrations/mdpay/helper.rb:10:in `<module:Mdpay>': uninitialized constant ActiveMerchant::Billing::Integrations::Helper (NameError)
    from /vagrant_data/apps/mobile-api/lib/payment/integrations/mdpay/helper.rb:9:in `<module:Integrations>'
    from /vagrant_data/apps/mobile-api/lib/payment/integrations/mdpay/helper.rb:8:in `<module:Billing>'
    from /vagrant_data/apps/mobile-api/lib/payment/integrations/mdpay/helper.rb:7:in `<module:ActiveMerchant>'
    from /vagrant_data/apps/mobile-api/lib/payment/integrations/mdpay/helper.rb:6:in `<top (required)>'
    from /vagrant_data/apps/mobile-api/config/all.rb:29:in `block in load_lib'
    from /vagrant_data/apps/mobile-api/config/all.rb:29:in `each'
    from /vagrant_data/apps/mobile-api/config/all.rb:29:in `load_lib'
    from /vagrant_data/apps/mobile-api/config/all.rb:4:in `initialize!'
    from /vagrant_data/apps/mobile-api/config/all.rb:43:in `<top (required)>'
    from /vagrant_data/apps/mobile-api/config/core.rb:48:in `load_application'
    from /vagrant_data/apps/mobile-api/config/core.rb:35:in `initialize!'
    from /vagrant_data/apps/mobile-api/config/core.rb:54:in `<top (required)>'
    from /vagrant_data/apps/mobile-api/config/application.rb:4:in `require'
    from /vagrant_data/apps/mobile-api/config/application.rb:4:in `<top (required)>'
    from /vagrant_data/apps/mobile-api/lib/command/cli.rb:163:in `require'
    from /vagrant_data/apps/mobile-api/lib/command/cli.rb:163:in `load_applicaiton'
    from /vagrant_data/apps/mobile-api/lib/command/cli.rb:14:in `c'
    from /home/vagrant/.rvm/gems/ruby-2.1.1/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /home/vagrant/.rvm/gems/ruby-2.1.1/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /home/vagrant/.rvm/gems/ruby-2.1.1/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /home/vagrant/.rvm/gems/ruby-2.1.1/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from ./bin/goliath:5:in `<main>'

/vagrant_data/apps/mobile-api/lib/payment/integrations/mdpay/helper.rb: line 10

...
class Helper < ActiveMerchant::Billing::Integrations::Helper
...

@ntalbott
Copy link
Contributor

@ZhangHanDong looks like you have a custom integration there; I would not expect it to work after an upgrade unless you adapt it to https://github.com/Shopify/offsite_payments. We built backwards compatibility for all built-in integrations in ActiveMerchant, but were not able to cover the case of external sub-classes.

I'd recommend either locking ActiveMerchant to the last version, or tweaking your integration to use https://github.com/Shopify/offsite_payments.

Sorry for the trouble!

@ZhangHanDong
Copy link
Author

Thanks. I have locked ActiveMerchant to 1.43.3.

cassioscabral added a commit to cassioscabral/catarse_paypal_express_v2 that referenced this issue Jul 27, 2016
@jengweneg
Copy link

Hello,
I am running into a similar type of issue.
After successfully instaling catarse_paypa_express gem, i can"t start the server because of the following error.
I have installed the most recent version of activemerchant (1.76.0)
Please help

bin/rails server -d -p3005
/usr/src/fiatope/config/application.rb:10: warning: already initialized constant OpenSSL::SSL::VERIFY_PEER
/usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.15.0/lib/bundler/runtime.rb:85:in rescue in block (2 levels) in require': There was an error while trying to load the gem 'catarse_paypal_express'. (Bundler::GemRequireError) Gem Load Error is: uninitialized constant ActiveMerchant::Billing::Integrations Backtrace for gem load error is: /usr/local/rvm/gems/ruby-2.1.3/gems/catarse_paypal_express-3.0.2/lib/catarse_paypal_express/gateway.rb:3:in class:Gateway'
/usr/local/rvm/gems/ruby-2.1.3/gems/catarse_paypal_express-3.0.2/lib/catarse_paypal_express/gateway.rb:2:in <module:CatarsePaypalExpress>' /usr/local/rvm/gems/ruby-2.1.3/gems/catarse_paypal_express-3.0.2/lib/catarse_paypal_express/gateway.rb:1:in <top (required)>'
/usr/local/rvm/gems/ruby-2.1.3/gems/catarse_paypal_express-3.0.2/lib/catarse_paypal_express.rb:3:in <top (required)>' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.15.0/lib/bundler/runtime.rb:82:in require'
/usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.15.0/lib/bundler/runtime.rb:82:in block (2 levels) in require' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.15.0/lib/bundler/runtime.rb:77:in each'
/usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.15.0/lib/bundler/runtime.rb:77:in block in require' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.15.0/lib/bundler/runtime.rb:66:in each'
/usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.15.0/lib/bundler/runtime.rb:66:in require' /usr/local/rvm/gems/ruby-2.1.3/gems/bundler-1.15.0/lib/bundler.rb:108:in require'
/usr/src/fiatope/config/application.rb:12:in <top (required)>' /usr/local/rvm/gems/ruby-2.1.3/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:79:in require'
/usr/local/rvm/gems/ruby-2.1.3/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:79:in block in server' /usr/local/rvm/gems/ruby-2.1.3/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:76:in tap'
/usr/local/rvm/gems/ruby-2.1.3/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:76:in server' /usr/local/rvm/gems/ruby-2.1.3/gems/railties-4.1.5/lib/rails/commands/commands_tasks.rb:40:in run_command!'
/usr/local/rvm/gems/ruby-2.1.3/gems/railties-4.1.5/lib/rails/commands.rb:17:in <top (required)>' /usr/src/fiatope/bin/rails:8:in require'
/usr/src/fiatope/bin/rails:8:in <top (required)>' /usr/local/rvm/gems/ruby-2.1.3/gems/spring-1.7.1/lib/spring/client/rails.rb:28:in load'
/usr/local/rvm/gems/ruby-2.1.3/gems/spring-1.7.1/lib/spring/client/rails.rb:28:in call' /usr/local/rvm/gems/ruby-2.1.3/gems/spring-1.7.1/lib/spring/client/command.rb:7:in call'
/usr/local/rvm/gems/ruby-2.1.3/gems/spring-1.7.1/lib/spring/client.rb:30:in run' /usr/local/rvm/gems/ruby-2.1.3/gems/spring-1.7.1/bin/spring:49:in <top (required)>'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants