Ruby on Rails Tutorial Chapter 6 RSpec tests failing

Hello all:

I'm a RoR newbie who is currently following the Ruby on Rails Tutorial: Learning by Example book (http://ruby.railstutorial.org/ chapters/modeling-users#sec:adding_a_secure_password). The following Chapter 6 RSpec tests are failing:

Failures:

1) User [31mFailure/Error:[0m [31mit { should be_valid }[0m [31mexpected valid? to return true, got false[0m [36m # ./spec/models/ user_spec.rb:19:in `block (2 levels) in '[0m

2) User when email format is valid should be valid [31mFailure/Error: [0m [31m@user.should be_valid[0m [31mexpected valid? to return true, got false[0m [36m # ./spec/models/user_spec.rb:51:in block (4 levels) in <top (required)>'[0m [36m # ./spec/models/user_spec.rb: 49:ineach'[0m [36m # ./spec/models/user_spec.rb:49:in `block (3 levels) in '[0m

3) User return value of authenticate method with valid password [31mFailure/Error:[0m [31mit { should == found_user.authenticate(@user.password) }[0m [31mNoMethodError:[0m [31mundefined method authenticate' for nil:NilClass←[0m [36m # ./spec/ models/user_spec.rb:94:inblock (4 levels) in '[0m

4) User return value of authenticate method with invalid password [31mFailure/Error:[0m [31mlet(:user_for_invalid_password) { found_user.authenticate("invalid") }[0m [31mNoMethodError:[0m [31mundefined method authenticate' for nil:NilClass[0m [36m # ./spec/ models/user_spec.rb:98:inblock (4 levels) in '[0m [36m # ./spec/models/ user_spec.rb:100:in `block (4 levels) in '[0m

5) User return value of authenticate method with invalid password [31mFailure/Error:[0m [31mlet(:user_for_invalid_password) { found_user.authenticate("invalid") }[0m [31mNoMethodError:[0m [31mundefined method authenticate' for nil:NilClass[0m [36m # ./spec/ models/user_spec.rb:98:inblock (4 levels) in '[0m [36m # ./spec/models/ user_spec.rb:101:in `block (4 levels) in '[0m

Finished in 3.56 seconds [31m20 examples, 5 failures[0m

Failed examples:

[31mrspec ./spec/models/user_spec.rb:19[0m [36m# User [0m [31mrspec ./ spec/models/user_spec.rb:47[0m [36m# User when email format is valid should be valid←[0m [31mrspec ./spec/models/user_spec.rb:94[0m [36m# User return value of authenticate method with valid password ←[0m [31mrspec ./spec/models/user_spec.rb:100[0m [36m# User return value of authenticate method with invalid password [0m [31mrspec ./spec/models/ user_spec.rb:101[0m [36m# User return value of authenticate method with invalid password [0m Slave(1) run done!