Agile Web Development with Rails, Edition 4

Agile Web Development with Rails, Edition 4

26.3 HAML 25.2 rake

26.1 Active Merchant

<Is 4111111111111111 valid?  false> expected but was
<Using rake (0.9.2.2) >.
<0> expected to be
>=
<1>.

Traceback:
  /home/rubys/git/awdwr/edition4/checkdepot.rb:378:in `block in <class:DepotTest>'

Determine if a credit card is valid

edit Gemfile
gem 'activemerchant'
bundle install
Using rake (0.9.2.2) 
Using i18n (0.6.0) 
Using multi_json (1.0.4) 
Using tzinfo (0.3.31) 
Using activesupport (4.0.0.beta) 
Using builder (3.0.0) 
Using activemodel (4.0.0.beta) 
Using erubis (2.7.0) 
Using journey (1.0.1.20120208102204) 
Using rack (1.4.1) 
Using rack-cache (1.1) 
Using rack-test (0.6.1) 
Using hike (1.2.1) 
Using tilt (1.3.3) 
Using sprockets (2.2.0) 
Using actionpack (4.0.0.beta) 
Using mime-types (1.17.2) 
Using polyglot (0.3.3) 
Using treetop (1.4.10) 
Using mail (2.4.1) 
Using actionmailer (4.0.0.beta) 
Using active_utils (1.0.2) 
Using braintree (2.13.4) 
Using money (3.7.1) 
Using activemerchant (1.20.3) 
Using arel (3.0.0.20120112113618) 
Using activerecord (4.0.0.beta) 
Using activeresource (4.0.0.beta) 
Using bcrypt-ruby (3.0.1) 
Using bundler (1.0.21) 
Using highline (1.6.11) 
Using net-ssh (2.3.0) 
Using net-scp (1.0.4) 
Using net-sftp (2.0.5) 
Using net-ssh-gateway (1.1.0) 
Using capistrano (2.9.0) 
Using coffee-script-source (1.2.0) 
Using execjs (1.3.0) 
Using coffee-script (2.2.0) 
Using rack-ssl (1.3.2) 
Using json (1.6.5) 
Using rdoc (3.12) 
Using thor (0.14.6) 
Using railties (4.0.0.beta) 
Using coffee-rails (3.2.0) 
Using jquery-rails (2.0.0) 
Using mysql2 (0.3.11) 
Using rails (4.0.0.beta) 
Using sass (3.1.15) 
Using sass-rails (4.0.0.beta) 
Using sqlite3 (1.3.5) 
Using uglifier (1.2.3) 
Using will_paginate (3.0.3) 
Updating .gem files in vendor/cache
Could not find activesupport-4.0.0.beta.gem for installation
edit script/creditcard.rb
credit_card = ActiveMerchant::Billing::CreditCard.new(
  number:     '4111111111111111',
  month:      '8',
  year:       '2009',
  first_name: 'Tobias',
  last_name:  'Luetke',
  verification_value:  '123' 
)
 
puts "Is #{credit_card.number} valid?  #{credit_card.valid?}"
rails runner script/creditcard.rb
/home/rubys/git/rails/activesupport/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- active_support/base64 (LoadError)
	from /home/rubys/git/rails/activesupport/lib/active_support/dependencies.rb:251:in `block in require'
	from /home/rubys/git/rails/activesupport/lib/active_support/dependencies.rb:236:in `load_dependency'
	from /home/rubys/git/rails/activesupport/lib/active_support/dependencies.rb:251:in `require'
	from /home/rubys/.rvm/gems/ruby-head-n34575/gems/activemerchant-1.20.3/lib/active_merchant.rb:33:in `<top (required)>'
	from /home/rubys/git/rails/activesupport/lib/active_support/dependencies.rb:251:in `require'
	from /home/rubys/git/rails/activesupport/lib/active_support/dependencies.rb:251:in `block in require'
	from /home/rubys/git/rails/activesupport/lib/active_support/dependencies.rb:236:in `load_dependency'
	from /home/rubys/git/rails/activesupport/lib/active_support/dependencies.rb:251:in `require'
	from /home/rubys/.rvm/gems/ruby-head-n34575/gems/activemerchant-1.20.3/lib/activemerchant.rb:1:in `<top (required)>'
	from /home/rubys/.rvm/gems/ruby-head-n34575/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
	from /home/rubys/.rvm/gems/ruby-head-n34575/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
	from /home/rubys/.rvm/gems/ruby-head-n34575/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each'
	from /home/rubys/.rvm/gems/ruby-head-n34575/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `block in require'
	from /home/rubys/.rvm/gems/ruby-head-n34575/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each'
	from /home/rubys/.rvm/gems/ruby-head-n34575/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require'
	from /home/rubys/.rvm/gems/ruby-head-n34575/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
	from /home/rubys/git/awdwr/edition4/work-200-40/depot/config/application.rb:7:in `<top (required)>'
	from /home/rubys/git/rails/railties/lib/rails/commands/runner.rb:43:in `require'
	from /home/rubys/git/rails/railties/lib/rails/commands/runner.rb:43:in `<top (required)>'
	from /home/rubys/git/rails/railties/lib/rails/commands.rb:64:in `require'
	from /home/rubys/git/rails/railties/lib/rails/commands.rb:64:in `<top (required)>'
	from script/rails:6:in `require'
	from script/rails:6:in `<main>'
edit Gemfile
# gem 'activemerchant'

26.3 HAML 25.2 rake