After creating order model and perform rake db:migrate, it is still necessary to run rake db:test:prepare before starting bundle exec rspec spec/models/order_spec.rb. Otherwise the test will fail and complain "Migrations are pending..." This is not mentioned in the book and may cause confusion to other users.