Giter VIP home page Giter VIP logo

Comments (18)

vongruenigen avatar vongruenigen commented on May 24, 2024

I also have the same issue on rails 3.1.rc5.

@rafamvc: There's a quick workaround for it. Just include it like that in your gemfile
gem 'annotate', :git => 'git://github.com/jeremyolliver/annotate_models.git', :branch => 'rake_compatibility'

Now you can execute it with bundle exec annotate.

@ctran: You've already merged a patch for that issue in #29. Why is it lost?

from annotate_models.

rafamvc avatar rafamvc commented on May 24, 2024

thank you!

from annotate_models.

rafamvc avatar rafamvc commented on May 24, 2024

:)

from annotate_models.

fayimora avatar fayimora commented on May 24, 2024

OMG i almost killed myself! Now i know its a rails 3.1 problem.. thanks @vongruenigen

from annotate_models.

ctran avatar ctran commented on May 24, 2024

I'm not sure why it's lost. Will check.

from annotate_models.

vongruenigen avatar vongruenigen commented on May 24, 2024

@ctran: I just checked the source and saw that the changes are not lost.

from annotate_models.

ctran avatar ctran commented on May 24, 2024

Thanks.

from annotate_models.

fayimora avatar fayimora commented on May 24, 2024

So can we use it with Rails3.1 now?

from annotate_models.

vongruenigen avatar vongruenigen commented on May 24, 2024

@ctran, sorry, maybe my hint was a lil bit confusing. The changes of the old patch are not lost, but there's another problem now. If I use it with Rails 3.1, I get the following error (same like @rafamvc):

/Users/dvg/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/railties/databases.rake:3:in `<top (required)>': undefined method `namespace' for main:Object (NoMethodError)
    from /Users/dvg/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/railtie.rb:26:in `load'
    from /Users/dvg/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/railtie.rb:26:in `block in <class:Railtie>'
    from /Users/dvg/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/railtie.rb:183:in `call'
    from /Users/dvg/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/railtie.rb:183:in `block in load_tasks'
    from /Users/dvg/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/railtie.rb:183:in `each'
    from /Users/dvg/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/railtie.rb:183:in `load_tasks'
    from /Users/dvg/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/engine.rb:395:in `block in load_tasks'
    from /Users/dvg/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/application/railties.rb:8:in `each'
    from /Users/dvg/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/application/railties.rb:8:in `all'
    from /Users/dvg/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/engine.rb:395:in `load_tasks'
    from /Users/dvg/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/application.rb:99:in `load_tasks'
    from /Users/dvg/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from Rakefile:7:in `<top (required)>'
    from /Users/dvg/.rvm/gems/ruby-1.9.2-p290/gems/annotate-2.4.0/lib/annotate.rb:17:in `load'
    from /Users/dvg/.rvm/gems/ruby-1.9.2-p290/gems/annotate-2.4.0/lib/annotate.rb:17:in `load_tasks'
    from /Users/dvg/.rvm/gems/ruby-1.9.2-p290/gems/annotate-2.4.0/bin/annotate:66:in `<top (required)>'
    from /Users/dvg/.rvm/gems/ruby-1.9.2-p290/bin/annotate:19:in `load'
    from /Users/dvg/.rvm/gems/ruby-1.9.2-p290/bin/annotate:19:in `<main>'

I will try to fix it. Maybe you've got an ide what the problem could be @ctran?

@fayimora: No you can't use the master branch with Rails 3.1, but the other solution which I've mentioned above will work properly.

from annotate_models.

stephanschielke avatar stephanschielke commented on May 24, 2024

gem 'annotate', '2.4.1.beta1'

works for me

from annotate_models.

 avatar commented on May 24, 2024

@DeusExMachina -- that worked for me too. Thanks -- this problem was starting to drive me nuts! :-)

from annotate_models.

rahulcn avatar rahulcn commented on May 24, 2024

Thakz guys!...

from annotate_models.

 avatar commented on May 24, 2024

thanks vongruenigen! worked like a charm.

from annotate_models.

fayimora avatar fayimora commented on May 24, 2024

@vongruenigen I tried but i still keep getting errors.. Am using rails3.1.1 and i used this on my gem fil

#gem 'annotate', :git => 'git://github.com/jeremyolliver/annotate_models.git', :branch => 'rake_compatibility'

nd i get this when i run annotate:

fayimora [test_app]$ bundle exec annotate --position before
/Users/fayimora/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/railties/databases.rake:3:in `': undefined method `namespace' for main:Object (NoMethodError)
    from /Users/fayimora/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/railtie.rb:26:in `load'
    from /Users/fayimora/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.1/lib/active_record/railtie.rb:26:in `block in '
    from /Users/fayimora/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/railtie.rb:183:in `call'
    from /Users/fayimora/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/railtie.rb:183:in `block in load_tasks'
    from /Users/fayimora/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/railtie.rb:183:in `each'
    from /Users/fayimora/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/railtie.rb:183:in `load_tasks'
    from /Users/fayimora/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/engine.rb:396:in `block in load_tasks'
    from /Users/fayimora/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/railties.rb:8:in `each'
    from /Users/fayimora/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/railties.rb:8:in `all'
    from /Users/fayimora/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/engine.rb:396:in `load_tasks'
    from /Users/fayimora/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application.rb:103:in `load_tasks'
    from /Users/fayimora/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from Rakefile:7:in `'
    from /Users/fayimora/.rvm/gems/ruby-1.9.2-p290/gems/annotate-2.4.0/lib/annotate.rb:17:in `load'
    from /Users/fayimora/.rvm/gems/ruby-1.9.2-p290/gems/annotate-2.4.0/lib/annotate.rb:17:in `load_tasks'
    from /Users/fayimora/.rvm/gems/ruby-1.9.2-p290/gems/annotate-2.4.0/bin/annotate:66:in `'
    from /Users/fayimora/.rvm/gems/ruby-1.9.2-p290/bin/annotate:19:in `load'
    from /Users/fayimora/.rvm/gems/ruby-1.9.2-p290/bin/annotate:19:in `'

any help??

EDIT****

Just realised you have to run

bundle exec annotate
and not
annotate

Does anyone know how i can make it automatically run the command every time i migrate?

from annotate_models.

sketchc89 avatar sketchc89 commented on May 24, 2024

@DeusExMachina, thanks a lot that worked great.

from annotate_models.

rayhatfield avatar rayhatfield commented on May 24, 2024

gem 'annotate', '2.4.1.beta1'

worked for me too. thanks!

from annotate_models.

beornborn avatar beornborn commented on May 24, 2024

#41 (comment) this works, thank's

from annotate_models.

theoryshaw avatar theoryshaw commented on May 24, 2024

gem 'annotate', '2.4.1.beta1'
worked for me too. thanks!

from annotate_models.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.