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

(eval):23:in create_initializer': undefined method overwrite' for File:Class (NoMethodError) #1

Open
msaspence opened this issue Jan 18, 2011 · 6 comments

Comments

@msaspence
Copy link

i've been following the instructions here: https://github.com/kristianmandrup/cream-app-mongoid

and i've come up against

    (eval):23:in `create_initializer': undefined method `overwrite' for File:Class (NoMethodError)
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/cream-0.8.9.2/lib/generators/cream/full_config/full_config_generator.rb:119:in `cream_initializer'
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/cream-0.8.9.2/lib/generators/cream/full_config/full_config_generator.rb:61:in `execute_generator'
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/cream-0.8.9.2/lib/generators/cream/full_config/full_config_generator.rb:47:in `main'
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `block in invoke_all'
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `each'
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `map'
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `invoke_all'
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/thor-0.14.6/lib/thor/group.rb:226:in `dispatch'
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/railties-3.0.3/lib/rails/generators.rb:163:in `invoke'
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/railties-3.0.3/lib/rails/commands/generate.rb:10:in `<top (required)>'
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `block in require'
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `block in load_dependency'
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:in `new_constants_in'
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/railties-3.0.3/lib/rails/commands.rb:17:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
@msaspence
Copy link
Author

i think this is because I didnt disable activerecord and the sqlite gem (although I do plan on using these are some point)

following the instructions exactly i now get

rails g cream:full_config --orm mongoid --strategy many_roles --admin-user
/www/cream/config/application.rb:10:in `<module:Cream>': uninitialized constant   Cream::Rails::Application (NameError)
    from /www/cream/config/application.rb:9:in `<top (required)>'
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/railties-3.0.3/lib/rails/commands.rb:15:in `require'
    from /opt/local/lib/ruby1.9/gems/1.9.1/gems/railties-3.0.3/lib/rails/commands.rb:15:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

@kristianmandrup
Copy link
Owner

Please don't name your Rails application 'Cream' as this will conflict with the Cream gem :P

@msaspence
Copy link
Author

Ah right you are
however even naming it cream_app the first issue persists

@kristianmandrup
Copy link
Owner

Yeah, sorry! Was due to an upgrade of the underlying gem 'sugar-high'. I now patched it to be backwards compatible (release 0.3.5). Should work if you try again and run bundle install anew or just bundle update sugar-high.
Cheers!

@Arjeno
Copy link

Arjeno commented Jun 21, 2011

Looks like this problem still persists. I just tried Cream for the first time but I'm getting the above error when using the generator.

@kristianmandrup
Copy link
Owner

This example app is very outdated. I am working on the successors to cream. You are most welcome to join in the effort.
This document explains some of my ideas for a complete (and better) solution.

https://docs.google.com/document/pub?id=10HmpLrkGGJsUBl5JlTk-fQkQJiHv_6tQ2BEU6SJO9_o

I now have created a troles gem that takes care of the roles and role groups part. The cancan-permits gem has also been updated, but still miss a few additions as described in the "Treatise on Roles" document. Then there is a need to create a new and better "wrapper" for devise, taking advantage of its support for multiple user accounts.

Please join in the effort! Thanks ;)

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

3 participants