Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Open
matenia opened this Issue · 5 comments

4 participants

@matenia

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:in
columns'
from (erb):11:in template'
from (eval):1:in
template'
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:in
each'
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:in
generate_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:in
send'
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:in
invoke_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:in
map'
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:in
map'
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:in
dispatch'
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:in
invoke'
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.

@creationmachine

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

@matenia

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.

@adamtrilling

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

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

@theodorton

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
Something went wrong with that request. Please try again.