Comments (18)
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.
thank you!
from annotate_models.
:)
from annotate_models.
OMG i almost killed myself! Now i know its a rails 3.1 problem.. thanks @vongruenigen
from annotate_models.
I'm not sure why it's lost. Will check.
from annotate_models.
@ctran: I just checked the source and saw that the changes are not lost.
from annotate_models.
Thanks.
from annotate_models.
So can we use it with Rails3.1 now?
from annotate_models.
@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.
gem 'annotate', '2.4.1.beta1'
works for me
from annotate_models.
@DeusExMachina -- that worked for me too. Thanks -- this problem was starting to drive me nuts! :-)
from annotate_models.
Thakz guys!...
from annotate_models.
thanks vongruenigen! worked like a charm.
from annotate_models.
@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 annotateand not
annotate
Does anyone know how i can make it automatically run the command every time i migrate?
from annotate_models.
@DeusExMachina, thanks a lot that worked great.
from annotate_models.
gem 'annotate', '2.4.1.beta1'
worked for me too. thanks!
from annotate_models.
#41 (comment) this works, thank's
from annotate_models.
gem 'annotate', '2.4.1.beta1'
worked for me too. thanks!
from annotate_models.
Related Issues (20)
- YARD formatter doesn't bigint types well
- Allow annotations at bottom of file HOT 1
- annotate --delete doesn't respect ignore_unknown_models
- Running annotate after changing sorting doesn't reorder the columns in the new comment
- 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.