Comments (29)
Same problem here with Ruby 1.9.2 and Rails 3.1.0.rc4
/Users/manuel/.rvm/gems/[email protected]/gems/activerecord-3.1.0.rc4/lib/active_record/railties/databases.rake:3:in `<top (required)>': undefined method `namespace' for main:Object (NoMethodError)
from /Users/manuel/.rvm/gems/[email protected]/gems/activesupport-3.1.0.rc4/lib/active_support/dependencies.rb:233:in `load'
from /Users/manuel/.rvm/gems/[email protected]/gems/activesupport-3.1.0.rc4/lib/active_support/dependencies.rb:233:in `block in load'
from /Users/manuel/.rvm/gems/[email protected]/gems/activesupport-3.1.0.rc4/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /Users/manuel/.rvm/gems/[email protected]/gems/activesupport-3.1.0.rc4/lib/active_support/dependencies.rb:639:in `new_constants_in'
from /Users/manuel/.rvm/gems/[email protected]/gems/activesupport-3.1.0.rc4/lib/active_support/dependencies.rb:223:in `load_dependency'
from /Users/manuel/.rvm/gems/[email protected]/gems/activesupport-3.1.0.rc4/lib/active_support/dependencies.rb:233:in `load'
from /Users/manuel/.rvm/gems/[email protected]/gems/activerecord-3.1.0.rc4/lib/active_record/railtie.rb:26:in `block in <class:Railtie>'
from /Users/manuel/.rvm/gems/[email protected]/gems/railties-3.1.0.rc4/lib/rails/railtie.rb:182:in `call'
from /Users/manuel/.rvm/gems/[email protected]/gems/railties-3.1.0.rc4/lib/rails/railtie.rb:182:in `block in load_tasks'
from /Users/manuel/.rvm/gems/[email protected]/gems/railties-3.1.0.rc4/lib/rails/railtie.rb:182:in `each'
from /Users/manuel/.rvm/gems/[email protected]/gems/railties-3.1.0.rc4/lib/rails/railtie.rb:182:in `load_tasks'
from /Users/manuel/.rvm/gems/[email protected]/gems/railties-3.1.0.rc4/lib/rails/application.rb:103:in `block in load_tasks'
from /Users/manuel/.rvm/gems/[email protected]/gems/railties-3.1.0.rc4/lib/rails/application/railties.rb:8:in `each'
from /Users/manuel/.rvm/gems/[email protected]/gems/railties-3.1.0.rc4/lib/rails/application/railties.rb:8:in `all'
from /Users/manuel/.rvm/gems/[email protected]/gems/railties-3.1.0.rc4/lib/rails/application.rb:103:in `load_tasks'
from /Users/manuel/.rvm/gems/[email protected]/gems/railties-3.1.0.rc4/lib/rails/railtie/configurable.rb:30:in `method_missing'
from Rakefile:7:in `<top (required)>'
from /Users/manuel/.rvm/gems/[email protected]/gems/annotate-2.4.0/lib/annotate.rb:17:in `load'
from /Users/manuel/.rvm/gems/[email protected]/gems/annotate-2.4.0/lib/annotate.rb:17:in `load_tasks'
from /Users/manuel/.rvm/gems/[email protected]/gems/annotate-2.4.0/bin/annotate:66:in `<top (required)>'
from /Users/manuel/.rvm/gems/[email protected]/bin/annotate:19:in `load'
from /Users/manuel/.rvm/gems/[email protected]/bin/annotate:19:in `<main>'
from annotate_models.
Anyone care to patch?
from annotate_models.
Sure, if you give me a pointer to what the problem might be. :)
It's deep in Rails so it might be a Rails issue?
Or must some dependency be loaded first in annotate-2.4.0/lib/annotate.rb
?
from annotate_models.
Just encountered the same issue. I suspect it's more to do with rake 0.9, than rails 3.1 The rake task loading changed from 0.8.7 to 0.9.X Some rake methods were namespaced into Rake::DSL so include Rake::DSL if defined?(Rake::DSL)
might help, though I haven't tried this yet.
I might have a play with patching/fixing this later
from annotate_models.
Didn't work for me. I tried inserting include Rake::DSL
in different places to no avail...
from annotate_models.
Started on trying out a patch just now, but missing a few dev tools as I'm on a new computer, I'll continue this later.
For anyone else trying to write a patch, it took a bit for me to work out what the development dependencies for annotate are, so I added them to the gemspec, and corrected a couple of load calls here. I'll send a pull-request for those changes once I've had a bit more of a play around and hopefully figured out this issue
from annotate_models.
Managed to work out what looks like a quite small fix to get this working over at: #29 (would have attached the pull request here if I knew how, not sure if that's possible)
from annotate_models.
+1 Great!
from annotate_models.
Can you tell me how to install the new update?
from annotate_models.
@swachian, The easiest way is to wait for @ctran to pull in that change into the main repository and release a new version. If you don't want to wait, add the following to your Gemfile
:
gem 'annotate', :git => 'git://github.com/jeremyolliver/annotate_models.git', :branch => 'rake_compatibility'
from annotate_models.
I'm doing exactly what manuel says, specifying via a git branch, though I'm using 'dependency_compatibility' as the branch, which includes both pull requests I submitted #29 and #30 and once these are released into a new version, I'll be switching back to a standard install.
from annotate_models.
@ctran Thanks for getting these merged in :) Looks like this issue, and issue #12 can be closed off now.
from annotate_models.
Thanks to all
from annotate_models.
i updated my annotate using gem 'annotate', :git => "https://github.com/ctran/annotate_models.git" and it still happens to me. is there any other fix or branch i should get?
from annotate_models.
@corroded are you remembering to call the correct executable via bunde exec annotate
? Otherwise the existing install of annotate will be used, not the most up to date one you've installed via git
from annotate_models.
oh oh oh. sorry i forgot about that! I should've just uninstalled and installed the gem instead of just doing another bundle install(which probably didn't refresh the installation) thanks for the reminder!
from annotate_models.
I had this same error. Got it to work by simply adding require 'rake'
in my Rakefile
.
EDIT: Oh, I guess this was the small fix jeremyolliver was referring to, except it patches annotated.rb
specifically.
from annotate_models.
Easy one
from annotate_models.
Thanks Jeremy for the fix. I'm currently working my way through Michael Hartl's RonR3 tutorial and this was a big help.
from annotate_models.
As calvinl commented ,it just need a require 'rake' in file Rakefile.
Thanks a lot.
from annotate_models.
annotate-2.4.1.beta1 seems to already be out there.
from annotate_models.
What does require 'rake' do? to the process?
from annotate_models.
great.. this saves me :)
from annotate_models.
Thanks it worked for me!
from annotate_models.
Thanks!
from annotate_models.
Great. This solved the issue. Thanks a lot.
from annotate_models.
Awesome, thank you!
from annotate_models.
@wxjaqy suggestion worked for me!
from annotate_models.
Confirmed.
Addding require 'rake' in RakeFile solved the problem.
ruby 1.9.2-p318
rails 3.2.3
annotate 2.4.0
from annotate_models.
Related Issues (20)
- Models are not annotated with zeitwerk folder collapsing
- To CTran and other maintainers: Thank you for this gem and the work y'all do HOT 1
- Update rubygems.org version to work with Rails 7 HOT 2
- Column default incorrectly showing as `NULL` HOT 3
- Rails 7 - datetime column comments are being converted into timestamptz
- my bad for the issue
- Annotation fails for columns with comments
- Comments get lost when generating annotations HOT 4
- [Feature request] Place column comments at the end of the line HOT 3
- 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
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.