[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

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

Jason Vogel

12/15/2006 7:39:00 PM

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