Coder Social home page Coder Social logo

Comments (29)

manuelmeurer avatar manuelmeurer commented on May 18, 2024

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.

ctran avatar ctran commented on May 18, 2024

Anyone care to patch?

from annotate_models.

manuelmeurer avatar manuelmeurer commented on May 18, 2024

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.

jeremyolliver avatar jeremyolliver commented on May 18, 2024

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.

manuelmeurer avatar manuelmeurer commented on May 18, 2024

Didn't work for me. I tried inserting include Rake::DSL in different places to no avail...

from annotate_models.

jeremyolliver avatar jeremyolliver commented on May 18, 2024

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.

jeremyolliver avatar jeremyolliver commented on May 18, 2024

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.

manuelmeurer avatar manuelmeurer commented on May 18, 2024

+1 Great!

from annotate_models.

swachian avatar swachian commented on May 18, 2024

Can you tell me how to install the new update?

from annotate_models.

manuelmeurer avatar manuelmeurer commented on May 18, 2024

@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.

jeremyolliver avatar jeremyolliver commented on May 18, 2024

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.

jeremyolliver avatar jeremyolliver commented on May 18, 2024

@ctran Thanks for getting these merged in :) Looks like this issue, and issue #12 can be closed off now.

from annotate_models.

swachian avatar swachian commented on May 18, 2024

Thanks to all

from annotate_models.

corroded avatar corroded commented on May 18, 2024

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.

jeremyolliver avatar jeremyolliver commented on May 18, 2024

@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.

corroded avatar corroded commented on May 18, 2024

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.

calvinl avatar calvinl commented on May 18, 2024

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.

m00nh3ck avatar m00nh3ck commented on May 18, 2024

Easy one

from annotate_models.

spindola avatar spindola commented on May 18, 2024

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.

eeewxj avatar eeewxj commented on May 18, 2024

As calvinl commented ,it just need a require 'rake' in file Rakefile.
Thanks a lot.

from annotate_models.

darkmuse avatar darkmuse commented on May 18, 2024

annotate-2.4.1.beta1 seems to already be out there.

from annotate_models.

svsvenu avatar svsvenu commented on May 18, 2024

What does require 'rake' do? to the process?

from annotate_models.

chezca1228 avatar chezca1228 commented on May 18, 2024

great.. this saves me :)

from annotate_models.

wlaurance avatar wlaurance commented on May 18, 2024

Thanks it worked for me!

from annotate_models.

plagi avatar plagi commented on May 18, 2024

Thanks!

from annotate_models.

albertovilla avatar albertovilla commented on May 18, 2024

Great. This solved the issue. Thanks a lot.

from annotate_models.

dankozlowski avatar dankozlowski commented on May 18, 2024

Awesome, thank you!

from annotate_models.

jonleung avatar jonleung commented on May 18, 2024

@wxjaqy suggestion worked for me!

from annotate_models.

jalvarezsamayoa avatar jalvarezsamayoa commented on May 18, 2024

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)

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.