I get a segmentation fault whenever I try to call authorize on the Authorize.net gateway whether I am using test or live credentials. I am using the latest version of the ActiveMerchant gem. Any ideas on resolving this?
credit_card = ActiveMerchant::Billing::CreditCard.new(:first_name => "First", :last_name => "Last", :number => "4007000000027", :month => "07", :year => "2012", :verification_value => "111", :type => 'visa')
options = { :billing_address => {:name => "First Last", :address1 => "12 Candy Ln", :city => "Sugarville", :state => "IL", :zip => "12345", :country => "USA" }, :description => "00001" }
gateway = ActiveMerchant::Billing::AuthorizeNetGateway.new(:login => 'scraped', :password => 'scraped', :test => true)
/Users/foo/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/net/http.rb:586: [BUG] Segmentation fault
ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-darwin10.4.0]
For me, the fix for this with an RVM version of ruby is to install it with the RVM OpenSSL package: http://rvm.beginrescueend.com/packages/openssl/
In particular, I used the following to install ruby 1.8.7-p174:
rvm package install iconv
rvm package install openssl
rvm install 1.8.7-p174 --with-openssl-dir=$HOME/.rvm/usr --with-iconv-dir=$rvm_path/usr