`connect': undefined method `verify_mode' for nil:NilClass


#1

Am using Ruby 1.8.4. I am getting this error:

/usr/lib/ruby/1.8/net/http.rb:565:in connect': undefined methodverify_mode’ for nil:NilClass (NoMethodError)
from /usr/lib/ruby/1.8/net/http.rb:555:in do_start' from /usr/lib/ruby/1.8/net/http.rb:544:instart’
from /usr/lib/ruby/1.8/net/http.rb:1031:in request' from /usr/lib/ruby/1.8/net/http.rb:840:inpost’
from
/usr/lib/ruby/gems/1.8/gems/payment-1.0.1/lib/payment/base.rb:52:in
get_response' from /usr/lib/ruby/gems/1.8/gems/payment-1.0.1/lib/payment/authorize_net.rb:45:insubmit’
from test.rb:14

This is the test script I am trying to run:

test.rb:

require ‘rubygems’
require ‘payment/authorize_net’

transaction = Payment::AuthorizeNet.new(
:login => ‘username’,
:password => ‘password’,
:amount => ‘1’,
:card_number => ‘4007000000027’,
:expiration => ‘0310’,
:first_name => ‘John’,
:last_name => ‘Doe’
)
begin
transaction.submit
puts “Card processed successfully: #{transaction.authorization}”
rescue Payment::PaymentError
puts “Card was rejected: #{transaction.error_message}”
end

Any ideas as to what might be wrong?