views:

18

answers:

1

When I'm creating a gem, how do I make the generator discoverable by Rails?

I have a generators directory with my generator inside. I symlinked it from ~/.rails/generators and it worked fine, but when I install the gem, even though the generators directory is installed, Rails doesn't find it.

A: 

There's nothing special to be done. Just having generators/blah/blah_generator.rb with a BlahGenerator class inside was enough. I was missing the "_generator" in the filename.

J. Pablo Fernández