Forum: Ruby on Rails `load_missing_constant': uninitialized constant Rails::Generator (NameError)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8d4c3605bb2853f5088f8719d352f3cd?d=identicon&s=25 Clem Rock (clemrock)
on 2009-05-12 06:12
(Received via mailing list)
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()
[/code]

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
[/code]

When I restart my server I get this:
`load_missing_constant': uninitialized constant Rails::Generator
(NameError)

Thanks,
Clem C
--
View this message in context:
http://www.nabble.com/%60load_missing_constant%27%...
Sent from the RubyOnRails Users mailing list archive at Nabble.com.
This topic is locked and can not be replied to.