small medium large xlarge

Generic-user-small
13 May 2011, 06:13
Randall Hawkins (3 posts)

Rails Experts:

I’ve been able to load Ruby/Rails/git on my Mac and a PC and have been reading “Agile… 4th Edition”, following along with the depot application. Until I got to page 123 I was able to keep my depot applications tracking the book perfectly.

Unfortunately, as I ran the rake test:functionals command at the bottom of p123 I got errors as follows:

HawksMac-7:depot Randy$ rake test:functionals (in /Users/Randy/work/depot) /opt/local/lib/ruby/gems/1.8/gems/activerecord-3.0.7/lib/active_record/associations.rb:1644:in configure_dependency_for_has_many': The :dependent option expects either :destroy, :delete_all, :nullify or :restrict (:distroy) (ArgumentError) from /opt/local/lib/ruby/gems/1.8/gems/activerecord-3.0.7/lib/active_record/associations.rb:984:in has_many’ from /opt/local/lib/ruby/gems/1.8/gems/activerecord-3.0.7/lib/active_record/autosave_association.rb:137:in has_many' from /Users/Randy/work/depot/app/models/cart.rb:2 from /opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in require’ from /opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in require' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:227:in load_dependency’ from /opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in require' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:346:in require_or_load’ from /opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:300:in depend_on' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:216:in require_dependency’ from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/engine.rb:138:in eager_load!' from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/engine.rb:137:in each’ from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/engine.rb:137:in eager_load!' from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/engine.rb:135:in each’ from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/engine.rb:135:in eager_load!' from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:108:in eager_load!’ from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/application/finisher.rb:41 from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:25:in instance_exec' from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:25:in run’ from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:50:in run_initializers' from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:49:in each’ from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:49:in run_initializers' from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:134:in initialize!’ from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:77:in send' from /opt/local/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:77:in method_missing’ from /Users/Randy/work/depot/config/environment.rb:5 from ./test/test_helper.rb:2:in require' from ./test/test_helper.rb:2 from ./test/functional/carts_controller_test.rb:1:in require’ from ./test/functional/carts_controller_test.rb:1 from /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in load' from /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5 from /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in each’ from /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5 rake aborted! Command failed with status (1): [/opt/local/bin/ruby -I”lib:test” “/opt/loc…] ——————————————- The (essentially) same errors occurred on my windows PC. Weird.

I retraced all my steps through Chapter 9 and for the life of me I can’t figure out what I did wrong.

Can anyone help me figure out how I can get back on track? Any help you could provide would be greatly appreciated.

Thank you.

Randy Hawkins, MD

Generic-user-small
17 May 2011, 18:06
Albert W Brisbin (2 posts)

I have exactly the same problem. I have tried to restart the whole project and came to the same error at the same place. I resolved my problem by being sure the rake db:migrate had functioned properly. What my son saw in yours is that there is a misspelling of destroy (distroy) in line 6.

You must be logged in to comment