recurly/recurly-client-ruby — Issue #40: Cannot create plan with recurly 2.0.x on Rails 3.0 & 3.1
Author: phuong-nguyen
Created: 2011-11-04 11:02:20+00:00
State: open

This piece of code failed miserably on our end:
plan = Recurly::Plan.create(
:plan_code => "gold",
:name => "The Gold Plan",
:unit_amount_in_cents => 79_00
)

Here is the back trace:

NoMethodError: undefined method `instruct!' for :Recurly::XML
from /Users/eastagile3/.rvm/gems/ruby-1.9.3-p0@bullseyehub/gems/activesupport-3.1.1/lib/active_support/core_ext/hash/conversions.rb:78:in `to_xml'
from /Users/eastagile3/.rvm/gems/ruby-1.9.3-p0@bullseyehub/gems/recurly-2.0.3/lib/recurly/money.rb:93:in `method_missing'
from /Users/eastagile3/.rvm/gems/ruby-1.9.3-p0@bullseyehub/gems/recurly-2.0.3/lib/recurly/resource.rb:687:in `block in to_xml'
from /Users/eastagile3/.rvm/gems/ruby-1.9.3-p0@bullseyehub/gems/recurly-2.0.3/lib/recurly/resource.rb:682:in `each'
from /Users/eastagile3/.rvm/gems/ruby-1.9.3-p0@bullseyehub/gems/recurly-2.0.3/lib/recurly/resource.rb:682:in `to_xml'
from /Users/eastagile3/.rvm/gems/ruby-1.9.3-p0@bullseyehub/gems/recurly-2.0.3/lib/recurly/resource.rb:718:in `save'
from /Users/eastagile3/.rvm/gems/ruby-1.9.3-p0@bullseyehub/gems/recurly-2.0.3/lib/recurly/resource.rb:336:in `block in create'
from /Users/eastagile3/.rvm/gems/ruby-1.9.3-p0@bullseyehub/gems/recurly-2.0.3/lib/recurly/resource.rb:540:in `initialize'
from /Users/eastagile3/.rvm/gems/ruby-1.9.3-p0@bullseyehub/gems/recurly-2.0.3/lib/recurly/resource.rb:336:in `new'
from /Users/eastagile3/.rvm/gems/ruby-1.9.3-p0@bullseyehub/gems/recurly-2.0.3/lib/recurly/resource.rb:336:in `create'

Here is my Gemfile:

source :rubygems

gem 'bundler', '>= 1.0.15'
gem 'rake', '~> 0.9.2'
gem 'rails', '3.1.1'
gem 'mysql2', '~> 0.3'
gem 'settingslogic'

# This is loaded by Rake thanks to Rails.
gem 'rdoc'

gem 'hoptoad_notifier'

# Dependencies for BackgrounDrb
gem 'chronic', '0.2.3'
gem 'packet', '0.1.7'

gem 'selenium-client', '1.2.18'
gem 'nokogiri'
gem 'fast_xs'
gem 'xml-simple', '1.0.12', :require => 'xmlsimple'
gem 'json'
gem 'oauth', '0.3.6'
gem 'dalli', '~> 1.0.4'
gem 'premailer'
gem 'newrelic_rpm', '~> 3.1'
gem 'bitly', '0.5.0'

gem 'aws-s3'
gem 'paperclip', '~> 2.4'

gem 'haml', '~> 3.1.2'
gem 'rails_autolink'

gem 'therubyracer', '0.9.4'

gem 'formtastic', '~> 2'
gem 'will_paginate', '~> 3'
gem 'simple-navigation', '~> 3.5'

gem 'paypal', '2.0.0'
gem 'recurly'
gem 'delayed_job', '~> 2.1'
gem 'net-ssh', '2.0.23', :require => 'net/ssh'
gem 'net-scp', '1.0.4', :require => 'net/scp' # Requires net-ssh
gem 'spreadsheet', '0.6.5.0'
gem 'rubyzip', '0.9.4', :require => 'zip/zip'
gem 'prawn', '0.8.4'
gem 'mime-types', '1.16', :require => 'mime/types'
gem 'mechanize', '1.0.0'
gem 'simple-rss', '1.2.3'
gem 'rest-client'
gem 'amatch'

gem 'geokit', '~> 1.6'
gem 'geokit-rails3'

gem 'tinymce-rails'

gem 'sunspot_rails'

gem 'uuid'

gem 'aws'
gem 'resque'

group :assets do
gem 'sass-rails', '~> 3.1.0'
gem 'coffee-rails', '~> 3.1.0'
gem 'uglifier'
gem 'compass', '~> 0.12.alpha'
gem 'uglifier'
end

gem 'jquery-rails'
gem 'dynamic_form'
gem 'devise'

group :development do
gem 'awesome_print', :require => 'ap'
gem 'haml-rails'
end

group :development, :test do
gem 'rspec-rails', '>= 2.6'
gem 'pickle'
gem 'pry'
gem 'ruby-debug-base19', '0.11.26'
gem 'ruby-debug19', '0.11.6'
gem 'linecache19', '0.5.13'
end

gem 'faker', :group => [:development, :test]

group :test do
gem 'cucumber-rails', '>= 1.1.1', require: nil
gem 'resque_spec'

# Use the latest version of Spork
#
# https://github.com/timcharper/spork/issues/37
gem 'spork', '>= 0.9.0.rc9'

gem 'simplecov'
gem 'shoulda-matchers', '>= 1.0.0.beta2'
gem 'capybara'
gem 'webmock'
gem 'vcr'
gem 'machinist', git: 'git://github.com/notahat/machinist.git'

# Require launchy so cucumber steps can open the current page in a browser
gem 'launchy', '2.0.3'

gem 'database_cleaner'
gem 'timecop', '0.3.5'
gem 'sunspot_test'
end

group :shell do
gem 'guard-rspec', '>= 0.3.1'
gem 'guard-cucumber', '>= 0.3.2'
gem 'guard-spork', '>= 0.1.10'
gem 'rb-fsevent'

# html2haml requires erubis
gem 'erubis'

# Required by `bundle viz`
gem 'ruby-graphviz'
end