0

When I run annotate at the command-line, I get the following error:

$ annotate
/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.7/lib/rails/application.rb:215:in `initialize_tasks': undefined method `task' for #<MyApp::Application:0x00000102e03b90> (NoMethodError)
    from /.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.7/lib/rails/application.rb:139:in `load_tasks'
    from /.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing'
    from Rakefile:8:in `<top (required)>'
    from /.rvm/gems/ruby-1.9.2-p0/gems/annotate-2.4.0/lib/annotate.rb:17:in `load'
    from /.rvm/gems/ruby-1.9.2-p0/gems/annotate-2.4.0/lib/annotate.rb:17:in `load_tasks'
    from /.rvm/gems/ruby-1.9.2-p0/gems/annotate-2.4.0/bin/annotate:66:in `<top (required)>'
    from /.rvm/gems/ruby-1.9.2-p0/bin/annotate:19:in `load'
    from /.rvm/gems/ruby-1.9.2-p0/bin/annotate:19:in `<main>'

This is what my Gemfile looks like:

source 'http://rubygems.org'

gem 'rails'

gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'will_paginate', '3.0.pre2'

gem 'paperclip', :git => 'git://github.com/thoughtbot/paperclip.git'
gem 'mime-types', :require => 'mime/types'

gem 'rails3-generators'

gem 'devise',  '~> 1.1.3'
gem 'devise_invitable', '~> 0.3.4'

gem 'declarative_authorization', :git => 'git://github.com/stffn/declarative_authorization.git'

gem 'aasm'
gem 'braintree'

#For voting
gem 'thumbs_up'

# For In-Place-Editing
gem 'best_in_place'

#For slugs for the plans
gem "friendly_id", "~> 3.2"

gem 'aws-s3'

group :development do
    # Server
    gem 'thin'
    gem 'annotate-models', '1.0.4'
    #gem 'rails-erd'
    gem 'annotate'
    gem 'faker', '0.3.1'
    gem 'ruby_parser'
end

This is all on my localhost btw.

marcamillion
  • 32,933
  • 55
  • 189
  • 380
  • Ran `bundle update` and that seems to have fixed this issue. It didn't before, so not sure why. Leave it up to Rails to make a fool of me :| – marcamillion Jun 13 '11 at 01:21

2 Answers2

0

I've solved this problem using gem 'annotate', ">=2.5.0".

I'm using ruby 1.9.2p320 and Rails 3.2.13.

0

Marcamillion, it probably broke because at one stage you had rake 0.9.0 installed, which broke a lot of things for a lot of people without deprecating methods or warning people. When you ran bundle update, it would have installed rake 0.9.2 which fixed this. Hope this helps someone else.

Cameron Walsh
  • 786
  • 5
  • 9