small medium large xlarge

Generic-user-small
15 Nov 2011, 17:14
Allan Berry (8 posts)

Hi there,

First post! Just getting started with the Depot example.

However, when the book asks me to run tests for the first time, on page 68, I get a long list of errors. I have no idea how to debug this. Are there any general tips on how to decipher Rails’ errors, and where to look for fixes? Google searches haven’t really helped much.

OSX 10.7.2, Ruby v1.9.2, Rails v3.1.1, Agile Rails 4th ed. v1.4.

Thanks very much! code snippet below.

-Allan

/Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/turn-0.8.3/lib/turn/autorun/minitest.rb:14:in <top (required)>’: MiniTest v1.6.0 is out of date. (RuntimeError) gem install minitest and add gem 'minitest' to you test helper. from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in require’ from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in block in require' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:225:in load_dependency’ from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in require' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/turn-0.8.3/lib/turn.rb:13:in <top (required)>’ from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in require' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in block in require’ from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:225:in load_dependency' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in require’ from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/test_help.rb:19:in <top (required)>' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in require’ from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in block in require' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:225:in load_dependency’ from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in require' from /Users/niteshade/Documents/Rails/depot/test/test_helper.rb:3:in <top (required)>’ from /Users/niteshade/Documents/Rails/depot/test/unit/helpers/products_helper_test.rb:1:in require' from /Users/niteshade/Documents/Rails/depot/test/unit/helpers/products_helper_test.rb:1:in <top (required)>’ from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:10:in require' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:10:in block (2 levels) in ' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:9:in `each' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:9:in `block in ' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:4:in `select' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:4:in `' /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/turn-0.8.3/lib/turn/autorun/minitest.rb:14:in `<top (required)>': MiniTest v1.6.0 is out of date. (RuntimeError) `gem install minitest` and add `gem 'minitest' to you test helper. from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:225:in `load_dependency' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/turn-0.8.3/lib/turn.rb:13:in `<top (required)>' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:225:in `load_dependency' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/test_help.rb:19:in `<top (required)>' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:225:in `load_dependency' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require' from /Users/niteshade/Documents/Rails/depot/test/test_helper.rb:3:in `<top (required)>' from /Users/niteshade/Documents/Rails/depot/test/functional/products_controller_test.rb:1:in `require' from /Users/niteshade/Documents/Rails/depot/test/functional/products_controller_test.rb:1:in `<top (required)>' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:10:in `require' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:10:in `block (2 levels) in ' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:9:in `each' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:9:in `block in ' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:4:in `select' from /Users/niteshade/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:4:in `' Errors running test:units, test:functionals!`

Samr_small_pragsmall
15 Nov 2011, 18:01
Sam Ruby (634 posts)

Short answer: go into your Gemfile, modify the line that contains the ‘turn’ gem to look like this:

gem 'turn', '0.8.2', :require => false

Once that is complete, execute the following command:

bundle update

Longer answer: the turn gem (note this in the top of your exception traceback) has been updated to require a version of Minitest that is later than the version that Rails 3.1 supports. There is a version of Rails in beta now (3.1.2.rc-2) that pins down the exact version of the Turn gem in the way I specified above. The next version of Rails (3.2) will drop the Turn gem entirely – all it does is pretty print testing output.

Based on where you are in the book, I would suggest simply making the changes above and not worrying about it further; these topics will be covered later in the book, but for now your best best is to focus on learning Rails before branching out.

Generic-user-small
16 Nov 2011, 06:44
Allan Berry (8 posts)

@Sam, thanks for your lucid answer. All tests passed now.

Yeah, I knew it was just a newbie problem… this is the sort of answer I was looking for… just enough to keep the ball rolling. I appreciate it.

I didn’t expect one of the authors of the book to show up! Maybe the ruby community is smaller than I thought. :)

Take care.

Generic-user-small
30 Dec 2011, 17:01
Thomas (1 post)

Hi Sam ! I need your help too. I Guess it is quite the type error than for Allan. I also bought the book that I’m following step by step. I use rails 3.1 et ruby 1.9.2 and I have this kind of error that is making me crazy now, when I try to launch a sample test. (page 79 of the book)

rvmsudo rake test Loaded suite /usr/local/rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_test_loader Started

ProductsControllerTest: ERROR should create product (0.01s) NoMethodError: undefined method products' for #<ProductsControllerTest:0x00000100987870> /usr/local/rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/action_dispatch/testing/assertions/routing.rb:175:in method_missing’

ERROR should destroy product (0.04s) 
      NoMethodError: undefined method `products' for #<ProductsControllerTest:0x00000103a50b28>
      /usr/local/rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/action_dispatch/testing/assertions/routing.rb:175:in `method_missing'

ERROR should get edit (0.01s) 
      NoMethodError: undefined method `products' for #<ProductsControllerTest:0x00000101cc4280>
      /usr/local/rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/action_dispatch/testing/assertions/routing.rb:175:in `method_missing'

ERROR should get index (0.01s) 
      NoMethodError: undefined method `products' for #<ProductsControllerTest:0x00000103e9d7a8>
      /usr/local/rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/action_dispatch/testing/assertions/routing.rb:175:in `method_missing'

ERROR should get new (0.01s) 
      NoMethodError: undefined method `products' for #<ProductsControllerTest:0x00000103d923e0>
      /usr/local/rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/action_dispatch/testing/assertions/routing.rb:175:in `method_missing'

ERROR should show product (0.01s) 
      NoMethodError: undefined method `products' for #<ProductsControllerTest:0x00000103a51ac8>
      /usr/local/rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/action_dispatch/testing/assertions/routing.rb:175:in `method_missing'

ERROR should update product (0.01s) 
      NoMethodError: undefined method `products' for #<ProductsControllerTest:0x00000102ff6330>
      /usr/local/rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.3/lib/action_dispatch/testing/assertions/routing.rb:175:in `method_missing'

Finished in 0.108756 seconds.

Thanks in advance ! cheers,

You must be logged in to comment