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

Already on GitHub? Sign in to your account

Kernel Error ... uninitialized constant Kernel::Page #23

Open
matenia opened this Issue Feb 14, 2011 · 5 comments

Comments

Projects
None yet
4 participants

matenia commented Feb 14, 2011

Hi, Just had a weird error whilst trying to use the themed generator to get my scaffold looking fantastic of course.

$rails g web_app_theme:themed admin/pages --layout=admin
/Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/web-app-theme-0.6.3/lib/generators/web_app_theme/themed/themed_generator.rb:80:in const_get': uninitialized constant Kernel::Page (NameError) from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/web-app-theme-0.6.3/lib/generators/web_app_theme/themed/themed_generator.rb:80:incolumns'
from (erb):11:in template' from (eval):1:intemplate'
from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/web-app-theme-0.6.3/lib/generators/web_app_theme/themed/themed_generator.rb:116:in generate_erb_views' from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/web-app-theme-0.6.3/lib/generators/web_app_theme/themed/themed_generator.rb:115:ineach'
from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/web-app-theme-0.6.3/lib/generators/web_app_theme/themed/themed_generator.rb:115:in generate_erb_views' from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/web-app-theme-0.6.3/lib/generators/web_app_theme/themed/themed_generator.rb:111:ingenerate_views'
from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/web-app-theme-0.6.3/lib/generators/web_app_theme/themed/themed_generator.rb:21:in copy_views' from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/thor-0.14.6/lib/thor/task.rb:22:insend'
from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/thor-0.14.6/lib/thor/task.rb:22:in run' from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/thor-0.14.6/lib/thor/invocation.rb:118:ininvoke_task'
from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/thor-0.14.6/lib/thor/invocation.rb:124:in invoke_all' from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/thor-0.14.6/lib/thor/shell.rb:14:inmap'
from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/thor-0.14.6/lib/thor/core_ext/ordered_hash.rb:73:in each' from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/thor-0.14.6/lib/thor/invocation.rb:124:inmap'
from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/thor-0.14.6/lib/thor/invocation.rb:124:in invoke_all' from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/thor-0.14.6/lib/thor/group.rb:226:indispatch'
from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/thor-0.14.6/lib/thor/base.rb:389:in start' from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/railties-3.0.3/lib/rails/generators.rb:163:ininvoke'
from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/railties-3.0.3/lib/rails/commands/generate.rb:10
from /Users/matenia/.rvm/gems/ruby-1.8.7-p302@rails3/gems/railties-3.0.3/lib/rails/commands.rb:17
from script/rails:6:in `require'
from script/rails:6

My scaffold is nested under admin and works ok. Is there maybe something I have done wrong?
Any help would be greatly appreciated.

I'm having the same exact issue. I am using RVM with ruby 1.9.2p136 and Rails 3.0.4.

matenia commented Feb 24, 2011

Yeah I've tried doing a few things but no such luck as yet. Hopefully I will have an epiphany and get the answer ...
Please keep me updated if you have any luck.

This happens if you try to run the themed generator on a controller that doesn't have an associated model.

Try passing the --themed_type=text argument to the generator, and it will generate a show view and _sidebar partial, instead of the CRUD views that are created normally.

matenia commented May 23, 2011

Ah ... thanks for this. Greatly appreciated. :)

i'm experiencing this issue as well.

My model is: Backend::Lead
My Controller is: Backend::LeadsController

When running:

$ rails g web_app_theme:themed backend/leads backend/lead --engine=haml

I get the following trace:
/Users/Theodor/.rvm/gems/ruby-1.9.2-p180@yenka-signup/gems/web-app-theme-0.7.0/lib/generators/web_app_theme/themed/themed_generator.rb:80:in `const_get': wrong constant name Backend::Lead (NameError)

Although Backend::Lead is defined in my class code.

Running
$ rails g web_app_theme:themed backend/leads --engine=haml

Gives me the following:
...wrong constant name Kernel::Lead (NameError)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment