开发者

How do I make my generator discoverable by Rails?

开发者 https://www.devze.com 2022-12-13 05:59 出处:网络
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 wh

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 doe开发者_运维技巧sn't find it.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消