How do I make my generator discoverable by Rails?
-
06-07-2019 - |
Question
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.
Solution
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow