Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rails generate resource fails on Rails 3.0.x #72

Closed
alindeman opened this issue Jun 1, 2012 · 6 comments
Closed

rails generate resource fails on Rails 3.0.x #72

alindeman opened this issue Jun 1, 2012 · 6 comments

Comments

@alindeman
Copy link
Contributor

$ rails generate resource foo
(erb):1:in `template': undefined method `module_namespacing' for #<Rails::Generators::SerializerGenerator:0x007fc2341b6950> (NoMethodError)
        from /Users/alindeman/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/erb.rb:838:in `eval'
        from /Users/alindeman/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/erb.rb:838:in `result'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/actions/file_manipulation.rb:111:in `block in template'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/actions/create_file.rb:54:in `call'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/actions/create_file.rb:54:in `render'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/actions/create_file.rb:63:in `block (2 levels) in invoke!'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/actions/create_file.rb:63:in `open'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/actions/create_file.rb:63:in `block in invoke!'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:114:in `call'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:114:in `invoke_with_conflict_check'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/actions/create_file.rb:61:in `invoke!'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/actions.rb:95:in `action'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/actions/create_file.rb:26:in `create_file'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/actions/file_manipulation.rb:110:in `template'
        from /Users/alindeman/Documents/workspace/active_model_serializers/lib/generators/serializer/serializer_generator.rb:12:in `create_serializer_file'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `block in invoke_all'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `each'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `map'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `invoke_all'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/group.rb:226:in `dispatch'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/invocation.rb:109:in `invoke'
        from /Users/alindeman/Documents/workspace/active_model_serializers/lib/generators/resource_override.rb:8:in `add_serializer'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `block in invoke_all'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `each'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `map'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `invoke_all'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/group.rb:226:in `dispatch'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/generators.rb:163:in `invoke'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/commands/generate.rb:10:in `<top (required)>'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `require'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `block in require'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:225:in `block in load_dependency'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:593:in `new_constants_in'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:225:in `load_dependency'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `require'
        from /Users/alindeman/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/commands.rb:17:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'

Rails 3.0.x does not have the module_namespacing method on Rails::Generators::NamedBase. Not sure what to do about it. Maybe just don't try to namespace under Rails 3.0?

@alindeman
Copy link
Contributor Author

@josevalim: why is this one closed? (It's not fixed by the #73)

@josevalim
Copy link
Contributor

Ops, my bad. Given the two issues, I am more willing to say we don't support 3.0.

@josevalim josevalim reopened this Jun 1, 2012
@alindeman
Copy link
Contributor Author

I thought you might say that :) I'm trying really hard to get this app upgraded, but it will take a bit of time. I rarely use rails generate resource though, so this one isn't bothering me too much.

@josevalim
Copy link
Contributor

I am closing this since we support only 3.1 onwards. :)

@tilo
Copy link

tilo commented Apr 18, 2013

3.0 support would be nice - is there at least a work-around you know of?

@steveklabnik
Copy link
Contributor

3.0 is not maintained by the Rails authors as well, so I don't plan on supporting it, no.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants