Forum: Ruby on Rails `connect': undefined method `verify_mode' for nil:NilClass

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Mufaddal K. (Guest)
on 2006-05-06 08:06
Am using Ruby 1.8.4. I am getting this error:

/usr/lib/ruby/1.8/net/http.rb:565:in `connect': undefined method
`verify_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:in `start'
        from /usr/lib/ruby/1.8/net/http.rb:1031:in `request'
        from /usr/lib/ruby/1.8/net/http.rb:840:in `post'
        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:in
`submit'
        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?
This topic is locked and can not be replied to.