refinerycms_membership icon indicating copy to clipboard operation
refinerycms_membership copied to clipboard

Uninitialized constant when generating refinerycms_memberships

Open frick156 opened this issue 14 years ago • 6 comments

Steps Taken:

  • Copied source into vendor/engines/refinerycms-memberships
  • Added "gem 'refinerycms-memberships', '1.0', :path => 'vendor/engines/'" to Gemfile
  • Ran "bundle install" successfully
  • Error occurred when attempting to execute "rails generate refinerycms-memberships"

Error: /Users/frick156/Projects/lorug/vendor/engines/refinerycms_memberships/lib/refinerycms-memberships.rb:19:in block in <class:Engine>': uninitialized constant Refinery::Admin::DashboardController (NameError) from /Users/frick156/.rvm/gems/ruby-1.9.2-p180@refinery/gems/activesupport-3.0.10/lib/active_support/lazy_load_hooks.rb:34:incall' from /Users/frick156/.rvm/gems/ruby-1.9.2-p180@refinery/gems/activesupport-3.0.10/lib/active_support/lazy_load_hooks.rb:34:in execute_hook' from /Users/frick156/.rvm/gems/ruby-1.9.2-p180@refinery/gems/activesupport-3.0.10/lib/active_support/lazy_load_hooks.rb:43:inblock in run_load_hooks' from /Users/frick156/.rvm/gems/ruby-1.9.2-p180@refinery/gems/activesupport-3.0.10/lib/active_support/lazy_load_hooks.rb:42:in each' from /Users/frick156/.rvm/gems/ruby-1.9.2-p180@refinery/gems/activesupport-3.0.10/lib/active_support/lazy_load_hooks.rb:42:inrun_load_hooks' from /Users/frick156/.rvm/gems/ruby-1.9.2-p180@refinery/gems/railties-3.0.10/lib/rails/application/finisher.rb:46:in block in <module:Finisher>' from /Users/frick156/.rvm/gems/ruby-1.9.2-p180@refinery/gems/railties-3.0.10/lib/rails/initializable.rb:25:ininstance_exec' from /Users/frick156/.rvm/gems/ruby-1.9.2-p180@refinery/gems/railties-3.0.10/lib/rails/initializable.rb:25:in run' from /Users/frick156/.rvm/gems/ruby-1.9.2-p180@refinery/gems/railties-3.0.10/lib/rails/initializable.rb:50:inblock in run_initializers' from /Users/frick156/.rvm/gems/ruby-1.9.2-p180@refinery/gems/railties-3.0.10/lib/rails/initializable.rb:49:in each' from /Users/frick156/.rvm/gems/ruby-1.9.2-p180@refinery/gems/railties-3.0.10/lib/rails/initializable.rb:49:inrun_initializers' from /Users/frick156/.rvm/gems/ruby-1.9.2-p180@refinery/gems/railties-3.0.10/lib/rails/application.rb:134:in initialize!' from /Users/frick156/.rvm/gems/ruby-1.9.2-p180@refinery/gems/railties-3.0.10/lib/rails/application.rb:77:inmethod_missing' from /Users/frick156/Projects/lorug/config/environment.rb:5:in <top (required)>' from /Users/frick156/.rvm/gems/ruby-1.9.2-p180@refinery/gems/railties-3.0.10/lib/rails/application.rb:103:inrequire_environment!' from /Users/frick156/.rvm/gems/ruby-1.9.2-p180@refinery/gems/railties-3.0.10/lib/rails/commands.rb:16:in <top (required)>' from script/rails:6:inrequire' from script/rails:6:in `

'

Environment information: Ruby version: 1.9.2 p180 Rails version: 3.0.10

Notes:

  • Also attempted to clone code into project, as instructed in installation steps. Same error.

frick156 avatar Oct 28 '11 14:10 frick156

I have the same issue, using

gem 'refinerycms', '~> 1.0.8'

rtacconi avatar Nov 02 '11 12:11 rtacconi

same problem with refinery 1.0.9

danielres avatar Dec 15 '11 20:12 danielres

problem disappeared, but I don't know how exactly

danielres avatar Dec 15 '11 21:12 danielres

Same problem - /vendor/engines/refinerycms_membership/lib/refinerycms-memberships.rb:19: uninitialized constant Refinery::Admin::DashboardController (NameError) I am using Rubyversion 1.8.7-352 Rails - 3.0.11 RefineryCMS - 1.0.9

shivanibhanwal avatar Dec 22 '11 11:12 shivanibhanwal

edit lib/refinerycms-memberships.rb and remove "Refinery" from "Refinery::Admin::DashboardController" to resulting " ::Admin::DashboardController".

the same with add_profile_fields_to_user.rb migration.

It worked for me. I've noticed this naming syntax in the other migrations.

sharonov avatar Jan 04 '12 19:01 sharonov

sharonov's comment fixed this for me. Be sure to update the add_profile_fields_to_user.rb migration as well.

watkinshughes avatar Feb 05 '12 18:02 watkinshughes