refinery / refinerycms-page-images

Adds an images tab to your pages so you can format a group of images really nicely on the frontend
104 stars 120 forks source link

generator does not work with refinery 0.9.9 #9

Closed dsaronin closed 13 years ago

dsaronin commented 13 years ago

trying to add refinerycms-page-images to fresh upgrade to 0.9.9 (now working otherwise, thank you!).

$ bundle install

then error occurs at: $ rails generate refinerycms_page_images

[WARNING] Could not load generator "generators/refinerycms_page_images_generator". 
Error: superclass mismatch for class RefinerycmsPageImages.
../gems/refinerycms-page-images-1.0.2/lib/generators/refinerycms_page_images_generator.rb:1

of which the referenced line is (in the page-images gem):

class RefinerycmsPageImages < Refinery::Generators::EngineInstaller
dsaronin commented 13 years ago
$ gem list refinery

*** LOCAL GEMS ***

refinerycms (0.9.9)
refinerycms-generators (0.9.9.1)
refinerycms-i18n (0.9.9.7)
refinerycms-inquiries (0.9.9.9)
refinerycms-page-images (1.0.2)
jeremyruppel commented 13 years ago

Seeing this as well. Here's my full stack trace, if it helps any:

$ rails g refinerycms_page_images
[WARNING] Could not load generator "generators/refinerycms_page_images_generator". Error: superclass mismatch for class RefinerycmsPageImages.
/opt/local/lib/ruby/gems/1.8/gems/refinerycms-page-images-1.0.2/lib/generators/refinerycms_page_images_generator.rb:1
/opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
/opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
/opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
/opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:in `new_constants_in'
/opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
/opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
/opt/local/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/generators.rb:286:in `lookup'
/opt/local/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/generators.rb:282:in `each'
/opt/local/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/generators.rb:282:in `lookup'
/opt/local/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/generators.rb:281:in `each'
/opt/local/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/generators.rb:281:in `lookup'
/opt/local/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/generators.rb:141:in `find_by_namespace'
/opt/local/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/generators.rb:161:in `invoke'
/opt/local/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/commands/generate.rb:10
/opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
/opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
/opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
/opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:in `new_constants_in'
/opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
/opt/local/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
/opt/local/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:17
script/rails:6:in `require'
script/rails:6
Could not find generator refinerycms_page_images.

I'm using Refinery 0.9.9 like OP.

parndt commented 13 years ago

This is an issue with refinerycms-page-images not refinerycms, working to fix.

dsaronin commented 13 years ago

I spent HOURS trying to figure out what is causing the supeclass mismatch .. searching for that class throughout all refinerycms gems, etc. cannot figure it out. There is an easy work-around to get going on your development: copy the two migrations from the gem's db/migrate directory into your project's db/migrate. be sure to rename them so that they will be at the end of the migration list. then just run rake db:migrate and you can get back to work.

parndt commented 13 years ago

Yeah, it's a confusing issue.. Trying to figure out the root cause at the moment..

dsaronin commented 13 years ago

as an FYI: refinerycms-inquiries engine has several syntactic and structural similarities to refinerycms-page-images .. yet it does NOT exhibit the error .. if that helps you track things down at all. the other thing that I found, using irb, is that there are two things which will cause this error: see examples below case 1: class Foo; end; class Bar; end; class PeanutClusters < Foo; end # this is ok class PeanutClusters < Bar; end # this is SUPERCLASS mismatch error

case 2 (same Foo Bar setup as above) class PeanutClusters < Foo; end # still ok class Foo < Bar; end # this is also SUPERCLASS mismatch error

parndt commented 13 years ago

Somehow naming this refinerycms_page_images was blowing up the generator called RefinerycmsPageImages. Closed by 0b0fef8b303a6c4f624c8cb952578f11480d27b5

parndt commented 13 years ago

Can you confirm it works for you now with 1.0.3 ?

jeremyruppel commented 13 years ago

Confirmed working flawlessly after update to 1.0.3 on my machine. Thanks for the quick fix!

dsaronin commented 13 years ago

Confirmed here as well; thanks for fixing this!