GithubHelp home page GithubHelp logo

Comments (15)

turadg avatar turadg commented on May 25, 2024

Version 2.4.1.beta1 works for me with Rails 3.1.1. Looks like you may have an old version of Rake, before the namespace was introduced.

from annotate_models.

 avatar commented on May 25, 2024

as per the log , I am using rake 0.9.2 :
uninitialized constant Rake::DSL (NameError)
from /Users/yves/.rvm/gems/ruby-1.9.2-p290@rails311/gems/rake-0.9.2/lib/rake/tasklib.rb:6:inmodule:Rake'

I tried to uninstall it then install again ... same error

BUT : I am running a brand new version 0.9.2 , so I added gem "rake", "0.8.7" in my Gemfile , then bundle update
and it runs well now ....

MacErwin:atelier yves$ annotate
Annotated (6): Blog, Category, Post, Product, Showcase, User

so Rake 0.9.2 is faulty !!! ( check your Gemfile.lock , are you running Rake 0.9.2 ?)

from annotate_models.

turadg avatar turadg commented on May 25, 2024

Yes, I am.

    rake (0.9.2)

Since it's working for you in 0.8.7 and working for me in 0.9.2, I'll close this issue.

from annotate_models.

pedrofoliveira avatar pedrofoliveira commented on May 25, 2024

I had the issue with:
Rails 3.1.1
annotate 2.4.1.beta1
rake 0.9.2.2

With rake 0.8.7 everything works as it is supposed to!

from annotate_models.

brookr avatar brookr commented on May 25, 2024

I also had this issue with:
Rails 3.1.1
Rake 0.9.2.2
annotate 2.4.1.beta1

Thanks for the tip, @pedrofoliveira... I got it to run by rolling back to rake 0.8.7, but that was kinda a pain in the butt.

annotate
/Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/rake-0.9.2.2/lib/rake/tasklib.rb:8:in <class:TaskLib>': uninitialized constant Rake::DSL (NameError) from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/rake-0.9.2.2/lib/rake/tasklib.rb:6:inmodule:Rake'
from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/rake-0.9.2.2/lib/rake/tasklib.rb:3:in <top (required)>' from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/rake-0.9.2.2/lib/rake/testtask.rb:4:in<top (required)>'
from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/railties-3.1.1/lib/rails/test_unit/testing.rake:2:in <top (required)>' from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/railties-3.1.1/lib/rails/test_unit/railtie.rb:12:inblock in class:TestUnitRailtie'
from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/railties-3.1.1/lib/rails/railtie.rb:183:in call' from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/railties-3.1.1/lib/rails/railtie.rb:183:inblock in load_tasks'
from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/railties-3.1.1/lib/rails/railtie.rb:183:in each' from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/railties-3.1.1/lib/rails/railtie.rb:183:inload_tasks'
from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/railties-3.1.1/lib/rails/engine.rb:396:in block in load_tasks' from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/railties-3.1.1/lib/rails/application/railties.rb:8:ineach'
from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/railties-3.1.1/lib/rails/application/railties.rb:8:in all' from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/railties-3.1.1/lib/rails/engine.rb:396:inload_tasks'
from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/railties-3.1.1/lib/rails/application.rb:103:in load_tasks' from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:inmethod_missing'
from Rakefile:7:in <top (required)>' from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/annotate-2.4.1.beta1/lib/annotate.rb:20:inload'
from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/annotate-2.4.1.beta1/lib/annotate.rb:20:in load_tasks' from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/annotate-2.4.1.beta1/bin/annotate:66:in<top (required)>'
from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/bin/annotate:19:in load' from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/bin/annotate:19:in

'

from annotate_models.

cnk avatar cnk commented on May 25, 2024

Annotate still doesn't work with Rails 3.1 'out of the box'. I finally got it working by using annotate 2.4.1.beta1 and editing the self.load_tasks in lib/annotate.rb to add require 'rake/dsl_definition' at line 19 (right before require 'rake')

Gem versions:
rake (0.9.2.2)
annotate (2.4.1.beta1)
rails (3.1.1)

Is there a backwards compatibility issue that prevents making that change in the real gem? And how is it that it works without that line for you turadg?

from annotate_models.

turadg avatar turadg commented on May 25, 2024

@cnk, I don't know. I just ran grep -r del_definition . in my project and it doesn't show up.

I released beta1 because it fixed some things but I couldn't test it on the different environments. Once we get this issue resolved we can release beta2 and maybe @ctran can release that as 2.4.2.

I don't know why requiring rake/dsl_definition is necessary. This SO post suggests putting it at the top of the Rakefile and everyone seems to agree. Isn't that a hack? This other SO post has an alternative but I don't know if it's any better.

@cnk, can you try this instead at line 19?

include Rake::DSL if defined?(Rake::DSL)

I think that will be backwards compatible.

from annotate_models.

 avatar commented on May 25, 2024

require 'rake/dsl_definition' works
..
include Rake::DSL if defined?(Rake::DSL) doesn't work

annotate (2.4.1.beta1)
rvm 1.9.2 / Ruby 1.9.2-p290 / Rails 3.1.1 / OS X 10.7.2

from annotate_models.

turadg avatar turadg commented on May 25, 2024

Ok, now does the require work under Rake 0.8.7? If not, anyone know what conditional to wrap that with?

from annotate_models.

yanguango avatar yanguango commented on May 25, 2024

Have same issue with

Gem versions:
rake (0.9.2.2)
annotate (2.4.1.beta1)
rails (3.1.1)

Resolve this issue by "bundle exec annotate"

from annotate_models.

 avatar commented on May 25, 2024

rails 3.1.3
Resolve this issue by "bundle exec annotate" too....

from annotate_models.

DaveCollinsJr avatar DaveCollinsJr commented on May 25, 2024

Yes that bundle exec annotate works for me. Plain old Annotate not working.

from annotate_models.

medampudi avatar medampudi commented on May 25, 2024

Thanks That "Bundle Exec" worked for me to... nothing else...

from annotate_models.

amalc avatar amalc commented on May 25, 2024

Same issue. bundle exec annotate works with 1.9.2p318 and rake 0.9.2.2 but not by itself. And this is with the edge version.

from annotate_models.

bogdan avatar bogdan commented on May 25, 2024

gemspec says it needs rake >=0.8.7 but it needs >= 0.9.0 in fact.

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.