uninitialized constant PaymentsController::ActiveMerchant

163 views
Skip to first unread message

soichi

unread,
Apr 12, 2012, 6:24:34 AM4/12/12
to activem...@googlegroups.com
Rails 3.1.3

in Gemfile, 
gem 'activemerchant', '~> 1.9.3'

in development.rb
  config.after_initialize do
    ActiveMerchant::Billing::Base.mode = :test
    ::GATEWAY = ActiveMerchant::Billing::PaypalGateway.new(
    :login => "xxxx_biz_api1.gmail.com",
    :password => "xxxx",
    :signature => "xxxxxxxxx"
    )
    PaypalExpressGateway.default_currency = "JPY"
  end

gives an error, 

ActionController::RoutingError (uninitialized constant PaymentsController::ActiveMerchant):
  app/controllers/payments_controller.rb:2:in `<class:PaymentsController>'
  app/controllers/payments_controller.rb:1:in `<top (required)>'

in payments_controller.rb,

class PaymentsController < ApplicationController
  include ActiveMerchant::Billing
  def index
  end
  def confirm
  end
  def complete
  end
  def checkout
    setup_response = gateway.setup_purchase(5000,
    :ip                => request.remote_ip,
    :return_url        => url_for(:action => 'confirm', :only_path => false),
    :cancel_return_url => url_for(:action => 'index', :only_path => false)
                                            )
    redirect_to gateway.redirect_url_for(setup_response.token)
  end
end


this is all I have so far.

I have put "require 'activemerchant'" at the top of this controller, but it gives an error,

cannot load such file -- activemerchant
Could anyone help me for this problem?
soichi

Nathaniel Talbott

unread,
Apr 12, 2012, 9:41:15 AM4/12/12
to activem...@googlegroups.com
That's a pretty old version of ActiveMerchant - can you try the most
recent and let us know if you still have the issue?

--
Nathaniel

> --
> You received this message because you are subscribed to the Google Groups
> "Active Merchant" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/activemerchant/-/yFRyc0KYOJgJ.
> To post to this group, send email to activem...@googlegroups.com.
> To unsubscribe from this group, send email to
> activemerchan...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/activemerchant?hl=en.

soichi

unread,
Apr 12, 2012, 8:24:21 PM4/12/12
to activem...@googlegroups.com
Thanks...that was such a stupid mistake of mine.
I now bundle installed the lasted and no such error is observed.

soichi

Nathaniel Talbott

unread,
Apr 12, 2012, 9:21:08 PM4/12/12
to activem...@googlegroups.com
Excellent - glad you got it working. Happy ActiveMerchant'ing :-)

--
Nathaniel

> --
> You received this message because you are subscribed to the Google Groups
> "Active Merchant" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/activemerchant/-/J_AjZPdnutkJ.

Reply all
Reply to author
Forward
0 new messages