small medium large xlarge

27 Jan 2013, 02:53
Craig Demyanovich (3 posts)

On p. 152 of the PDF and in support_code/17/lib/nice_bank.rb, we set :account as follows:

set :account do
  fail 'account has not been set'

Later on p. 154 of the PDF and in support_code/18/features/support/world_extensions.rb, we set account as follows:

Sinatra::Application.account = account

This results in an error

undefined method `account=' for Sinatra::Application:Class (NoMethodError)

for me. Using the pry gem and trial and error, I was able to make the scenario pass by eliminating the code that sets account with the block and failure message in nice_bank.rb and changing the code in world_extensions.rb to

Sinatra::Application.set :account, account

My Gemfile:

source ''

gem 'sinatra', '1.3.4'

group :development do
  gem 'rspec', '2.12.0'
  gem 'cucumber', '1.2.1'
  gem 'capybara', '2.0.2'
  gem 'launchy', '2.1.2'
  gem 'pry', ''

Has you seen this error? Did you solve it the same way?


29 Jan 2013, 14:00
Heather Poole (5 posts)

Question in your lib/nicebank.rb

have you entered this line of code?

require ‘sinatra’

  You must be logged in to comment