ryanb / nifty-generators

A collection of useful Rails generator scripts.
MIT License
1.98k stars 283 forks source link

Errors when running tests: undefined method `task' #105

Open andyw8 opened 13 years ago

andyw8 commented 13 years ago

Also fails when building on TravisCI: http://travis-ci.org/#!/andyw8/nifty-generators

Ruby 1.9.2 Bundler 1.0.13 Mac OS X 10.6.6

$ bundle $ rake --trace * Invoke default (first_time) * Invoke features (first_time) \ Execute features bundle exec /Users/andy0/.rvm/rubies/ruby-1.9.2-p0/bin/ruby -I "/Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/cucumber-0.10.2/lib:lib" "/Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/cucumber-0.10.2/bin/cucumber" features --format progress create
create README create Rakefile create config.ru create .gitignore create Gemfile create app create app/controllers/application_controller.rb create app/helpers/application_helper.rb create app/mailers create app/models create app/views/layouts/application.html.erb create config create config/routes.rb create config/application.rb create config/environment.rb create config/environments create config/environments/development.rb create config/environments/production.rb create config/environments/test.rb create config/initializers create config/initializers/backtrace_silencers.rb create config/initializers/inflections.rb create config/initializers/mime_types.rb create config/initializers/secret_token.rb create config/initializers/session_store.rb create config/locales create config/locales/en.yml create config/boot.rb create config/database.yml create db create db/seeds.rb create doc create doc/README_FOR_APP create lib create lib/tasks create lib/tasks/.gitkeep create log create log/server.log create log/production.log create log/development.log create log/test.log create public create public/404.html create public/422.html create public/500.html create public/favicon.ico create public/index.html create public/robots.txt create public/images create public/images/rails.png create public/stylesheets create public/stylesheets/.gitkeep create public/javascripts create public/javascripts/application.js create public/javascripts/controls.js create public/javascripts/dragdrop.js create public/javascripts/effects.js create public/javascripts/prototype.js create public/javascripts/rails.js create script create script/rails create test create test/fixtures create test/functional create test/integration create test/performance/browsing_test.rb create test/test_helper.rb create test/unit create tmp create tmp/sessions create tmp/sockets create tmp/cache create tmp/pids create vendor/plugins create vendor/plugins/.gitkeep .. gemfile bcrypt-ruby gemfile mocha create app/models/user.rb create app/controllers/users_controller.rb create app/controllers/sessions_controller.rb create app/helpers/users_helper.rb create app/helpers/sessions_helper.rb create app/views/users/new.html.erb create app/views/users/edit.html.erb create app/views/users/_form.html.erb create app/views/sessions/new.html.erb create lib/controller_authentication.rb route resources :users route resources :sessions route match 'login' => 'sessions#new', :as => :login route match 'logout' => 'sessions#destroy', :as => :logout route match 'signup' => 'users#new', :as => :signup route match 'user/edit' => 'users#edit', :as => :edit_current_user create db/migrate/20110521124123_create_users.rb insert config/application.rb insert app/controllers/application_controller.rb create test/fixtures/users.yml create test/unit/user_test.rb create test/functional/users_controller_test.rb create test/functional/sessions_controller_test.rb ...... force app/views/layouts/application.html.erb create public/stylesheets/application.css create app/helpers/layout_helper.rb create app/helpers/error_messages_helper.rb .rake aborted! undefined method `task' for #RailsApp::Application:0x000001015a9400

(See full trace by running task with --trace) F-

[ ... snip ... ]

(::) failed steps (::)

expected false to be true (RSpec::Expectations::ExpectationNotMetError) ./features/step_definitions/common_steps.rb:2:in /^I run "([^\"]*)"$/' features/nifty_authentication.feature:36:inAnd I run "rake db:migrate"'

expected false to be true (RSpec::Expectations::ExpectationNotMetError) ./features/step_definitions/common_steps.rb:2:in /^I run "([^\"]*)"$/' features/nifty_authentication.feature:64:inAnd I run "rake db:migrate"'

expected false to be true (RSpec::Expectations::ExpectationNotMetError) ./features/step_definitions/common_steps.rb:2:in /^I run "([^\"]*)"$/' features/nifty_authentication.feature:76:inAnd I run "rake db:migrate"'

expected false to be true (RSpec::Expectations::ExpectationNotMetError) ./features/step_definitions/common_steps.rb:2:in /^I run "([^\"]*)"$/' features/nifty_scaffold.feature:21:inAnd I run "rake db:migrate"'

expected false to be true (RSpec::Expectations::ExpectationNotMetError) ./features/step_definitions/common_steps.rb:2:in /^I run "([^\"]*)"$/' features/nifty_scaffold.feature:36:inAnd I run "rake db:migrate"'

expected false to be true (RSpec::Expectations::ExpectationNotMetError) ./features/step_definitions/common_steps.rb:2:in /^I run "([^\"]*)"$/' features/nifty_scaffold.feature:62:inAnd I run "rake db:migrate"'

expected false to be true (RSpec::Expectations::ExpectationNotMetError) ./features/step_definitions/common_steps.rb:2:in /^I run "([^\"]*)"$/' features/nifty_scaffold.feature:72:inAnd I run "rake db:migrate"'

Failing Scenarios: cucumber features/nifty_authentication.feature:6 # Scenario: Generate default authentication cucumber features/nifty_authentication.feature:39 # Scenario: Generate named authentication cucumber features/nifty_authentication.feature:67 # Scenario: Generate named authentication with rspec cucumber features/nifty_scaffold.feature:6 # Scenario: Generate scaffold for simple resource cucumber features/nifty_scaffold.feature:25 # Scenario: Generate scaffold with rspec tests cucumber features/nifty_scaffold.feature:46 # Scenario: Generate scaffold for namespaced resource cucumber features/nifty_scaffold.feature:66 # Scenario: Generate scaffold with a namespaced model

13 scenarios (7 failed, 6 passed) 94 steps (7 failed, 16 skipped, 71 passed) 2m1.324s rake aborted! Command failed with status (1): [bundle exec /Users/andy0/.rvm/rubies/ruby-...] /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/file_utils.rb:53:in block in create_shell_runner' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/file_utils.rb:45:incall' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/file_utils.rb:45:in sh' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/file_utils_ext.rb:36:insh' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/cucumber-0.10.2/lib/cucumber/rake/task.rb:79:in run' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/cucumber-0.10.2/lib/cucumber/rake/task.rb:149:inblock in define_task' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/task.rb:205:in call' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/task.rb:205:inblock in execute' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/task.rb:200:in each' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/task.rb:200:inexecute' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/task.rb:158:in block in invoke_with_call_chain' /Users/andy0/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/monitor.rb:201:inmon_synchronize' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/task.rb:151:in invoke_with_call_chain' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/task.rb:176:inblock in invoke_prerequisites' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/task.rb:174:in each' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/task.rb:174:ininvoke_prerequisites' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/task.rb:157:in block in invoke_with_call_chain' /Users/andy0/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/monitor.rb:201:inmon_synchronize' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/task.rb:151:in invoke_with_call_chain' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/task.rb:144:ininvoke' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:112:in invoke_task' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:90:inblock (2 levels) in top_level' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:90:in each' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:90:inblock in top_level' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:129:in standard_exception_handling' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:84:intop_level' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:62:in block in run' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:129:instandard_exception_handling' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:59:in run' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/bin/rake:31:in<top (required)>' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in load' /Users/andy0/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in

' Tasks: TOP => default => features $

andyw8 commented 13 years ago

Seems this is due to Rake 0.9.0 being broken: http://stackoverflow.com/questions/5287121/undefined-method-task-using-rake-0-9-0-beta-4

RKushnir commented 13 years ago

Yes, you have to revert rake back to 0.8.7 for now, until they fix it