Comments (15)
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.
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.
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.
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.
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:in
module: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:in
block in class:TestUnitRailtie'
from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/railties-3.1.1/lib/rails/railtie.rb:183:incall' from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/railties-3.1.1/lib/rails/railtie.rb:183:in
block in load_tasks'
from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/railties-3.1.1/lib/rails/railtie.rb:183:ineach' from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/railties-3.1.1/lib/rails/railtie.rb:183:in
load_tasks'
from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/railties-3.1.1/lib/rails/engine.rb:396:inblock 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:in
each'
from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/railties-3.1.1/lib/rails/application/railties.rb:8:inall' from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/railties-3.1.1/lib/rails/engine.rb:396:in
load_tasks'
from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/railties-3.1.1/lib/rails/application.rb:103:inload_tasks' from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:in
method_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:in
load'
from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/gems/annotate-2.4.1.beta1/lib/annotate.rb:20:inload_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:inload' from /Users/brookr/.rvm/gems/ruby-1.9.2-p290@RSG/bin/annotate:19:in
from annotate_models.
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.
@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.
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.
Ok, now does the require work under Rake 0.8.7? If not, anyone know what conditional to wrap that with?
from annotate_models.
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.
rails 3.1.3
Resolve this issue by "bundle exec annotate" too....
from annotate_models.
Yes that bundle exec annotate works for me. Plain old Annotate not working.
from annotate_models.
Thanks That "Bundle Exec" worked for me to... nothing else...
from annotate_models.
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.
gemspec says it needs rake >=0.8.7 but it needs >= 0.9.0 in fact.
from annotate_models.
Related Issues (20)
- Next release? HOT 2
- Active Admin not working when running migrations
- Is there any way to ignore attributes?
- Reformat Column comments HOT 1
- Additional index annotation to other table with same name but with prefix HOT 1
- Unable to annotate: ActiveRecord::Encryption::Errors::Decryption HOT 4
- Annotate gem does not support Rails autoloader collapsed directories HOT 4
- Please add a ruby version constraint to gemfile
- How should I set up a CI job to ensure that annotations are up to date? HOT 3
- Column wrongly mistaken as a geometric point
- Fix code scanning alert - Polynomial regular expression used on uncontrolled data
- Rails 7, annotate --routes failed HOT 5
- Can't execute `annotate` or `bundle exec annotate` commands HOT 2
- Unable to annotate a single model HOT 1
- Make `with_comment_column` work with `Annotate.set_defaults` HOT 7
- Configuration for custom spec directory
- Does not find factories with default suffix example
- annotate_models doesn't auto-annotate on down / rollback migrations in multi-DB environments
- Throws error when using composite primary keys (supported natively by rails 7.1) HOT 1
- Output columns in database schema order, not A-Z order. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from annotate_models.