Problem using a Gem... (CreditCard is not a module)

J

Jason Vogel

Disclaimer : Ruby Nuby
Install:

[C:] C:\Develop\ruby\bin
gem install creditcard --include-dependencies
Successfully installed creditcard-1.0
Installing ri documentation for creditcard-1.0...
Installing RDoc documentation for creditcard-1.0...

Restarted server...

Source :

class ContractPayment < ActiveRecord::Base

set_table_name "contract_payment"
set_primary_key "contract_payment_id"
set_sequence_name "contract_payment_id_seq"

belongs_to :contract, :foreign_key => "contract_id"

validates_presence_of :contract_id, :credit_card_type_code,
:credit_card_type_prefix, :credit_card_expiration_date,
:credit_card_number, :credit_card_validation_code
validates_numericality_of :credit_card_number
validates_length_of :credit_card_number, :within => 13..16

require "creditcard"
....

Restarted server to pick model changes...

Result :

" TypeError in Offer renewalController#take_payment

CreditCard is not a module"


Okay, so what silly mistake am I making.

Thanks,
Jason
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top