27 Jan 2013, 02:53
Generic-user-small

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'
end

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 'https://rubygems.org'

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', '0.9.11.4'
end

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

Thanks.

29 Jan 2013, 14:00
Generic-user-small

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