#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    174
    Rep Power
    12

    `load_missing_constant': uninitialized constant Rails::Generator (NameError)


    Hello,
    I'm probably missing something pretty basic here as a rails newbie but I'm trying to write a plugin and I am trying to get my generator to work.

    I am trying to call the manifest method in my vendor/plugins/media_module/generators/media_module_generator.rb from my vendor/plugins/media_module/init.rb.

    here's the code in vendor/plugins/media_module/init.rb:
    Code:
    require File.join(File.dirname(__FILE__), '/generators/media_module_generator')
    media_mod_generatore = MediaModuleGenerator.new 
    media_mod_generatore::manifest()
    and here's my code in vendor/plugins/media_module/generators/media_module_generator.rb:
    Code:
    class MediaModuleGenerator < Rails::Generator::NamedBase
      def manifest
        record do |m|
          m.file "media_controller.rb", "app/controllers/media_controller.rb"
          m.file "media.rb", "app/models/media.rb"
        end
      end
    end
    When I restart my server I get this:
    `load_missing_constant': uninitialized constant Rails::Generator (NameError)

    Thanks,
    Clem C
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    174
    Rep Power
    12
    Shameless boot! This is driving me crazy!

IMN logo majestic logo threadwatch logo seochat tools logo