undefined method `namespace' for CalendarDateSelect::Railtie:Class [Rails 3.0.8.rc1] #1322

Closed
paneq opened this Issue May 26, 2011 · 10 comments

Comments

Projects
None yet
4 participants
Contributor

paneq commented May 26, 2011

The error occurs when loading railtie from gem. This is probably one more issue related to new version of rake - 0.9 .

Original file: https://github.com/paneq/calendar_date_select/blob/977048211b94599fe0f08eb37a481f3d69df48f6/lib/calendar_date_select.rb

module CalendarDateSelect
  class Railtie < ::Rails::Railtie

    rake_tasks do
      namespace :calendar do
        task :install do
        end
      end
    end

  end
end

Stacktrace:

/home/rupert/.rvm/gems/ruby-1.9.2-p136/bundler/gems/calendar_date_select-977048211b94/lib/calendar_date_select.rb:31:in `block in <class:Railtie>'
/home/rupert/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.8.rc1/lib/rails/railtie.rb:185:in `call'
/home/rupert/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.8.rc1/lib/rails/railtie.rb:185:in `each'
/home/rupert/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.8.rc1/lib/rails/railtie.rb:185:in `load_tasks'
/home/rupert/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.8.rc1/lib/rails/application.rb:140:in `block in load_tasks'
/home/rupert/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.8.rc1/lib/rails/application/railties.rb:11:in `each'
/home/rupert/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.8.rc1/lib/rails/application/railties.rb:11:in `all'
/home/rupert/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.8.rc1/lib/rails/application.rb:140:in `load_tasks'
/home/rupert/.rvm/gems/ruby-1.9.2-p136/gems/railties-3.0.8.rc1/lib/rails/application.rb:77:in `method_missing'
/home/rupert/develop/gavdihrpif/Rakefile:36:in `<top (required)>'
/home/rupert/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load'
/home/rupert/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/home/rupert/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.0/lib/rake/application.rb:495:in `raw_load_rakefile'
/home/rupert/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.0/lib/rake/application.rb:78:in `block in load_rakefile'
/home/rupert/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling'
/home/rupert/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.0/lib/rake/application.rb:77:in `load_rakefile'
/home/rupert/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.0/lib/rake/application.rb:61:in `block in run'
/home/rupert/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling'
/home/rupert/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.0/lib/rake/application.rb:59:in `run'
/home/rupert/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.9.0/bin/rake:31:in `<top (required)>'
/home/rupert/.rvm/gems/ruby-1.9.2-p136/bin/rake:19:in `load'
/home/rupert/.rvm/gems/ruby-1.9.2-p136/bin/rake:19:in `<main>'
Contributor

paneq commented May 26, 2011

The error occures during execution of rake command in rails application directory. However it does not occur during execution of rails c command.

Adding extend Rake::DSL if defined? Rake::DSL line before rake_tasks block helps.

Contributor

radar commented May 26, 2011

Possible fixed by this one: #1317

Contributor

paneq commented May 26, 2011

Sad that there are no tests for that...

Contributor

radar commented May 26, 2011

(additional) patches welcome :)

Owner

tenderlove commented May 26, 2011

I think this was fixed in 9e88b87. I'm closing for now. Please reopen if it's still breaking!

@tenderlove tenderlove closed this May 26, 2011

Contributor

paneq commented May 26, 2011

I would like to reopen however I do not have permissions for doing it :-(

18:24 <ruby-1.9.2-p136> ~/develop/gavdihrpif (stable) > cat Gemfile | grep rails
gem 'rails', :git => 'git://github.com/rails/rails.git', :branch => "3-0-stable"

18:24 <ruby-1.9.2-p136> ~/develop/gavdihrpif (stable) > rake --version
rake, version 0.9.0

18:24 <ruby-1.9.2-p136> ~/develop/gavdihrpif (stable) > bundle show rails
/home/rupert/.rvm/gems/ruby-1.9.2-p136/bundler/gems/rails-072e1ca5ea70

18:24 <ruby-1.9.2-p136> ~/develop/gavdihrpif (stable) > rake test:units
rake aborted!
undefined method `namespace' for CalendarDateSelect::Railtie:Class

@tenderlove tenderlove reopened this May 26, 2011

Owner

tenderlove commented May 26, 2011

doh, okay. Reopening.

tenderlove added a commit that referenced this issue May 26, 2011

@tenderlove tenderlove reopened this May 26, 2011

Owner

tenderlove commented May 26, 2011

This isn't actually fixed, I accidentally put the wrong number in the commit message.

tenderlove added a commit that referenced this issue May 26, 2011

tenderlove added a commit that referenced this issue May 27, 2011

Contributor

parndt commented May 28, 2011

What pain rake 0.9.0 caused :(
Thanks everyone!

Contributor

paneq commented May 28, 2011

This is not fixed in 3.0.8.rc2

sirlantis added a commit to sirlantis/rails that referenced this issue May 29, 2011

arunagw pushed a commit to arunagw/rails that referenced this issue May 31, 2011

Merge pull request #1397 from sirlantis/3-0-8
Really fix #1322 (Rake::DSL issue)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment