简体   繁体   中英

How do you create a rails migration generator in a ruby gem?

Im creating a simple Rails 2.3.8 gem and need a migration file inside it. I following this structure:

/
/generators
/generators/conductor_migration
/generators/conductor_migration/conductor_migration_generator.rb
/generators/conductor_migration/templates
/generators/conductor_migration/templates/conductor_migration.rb

but when I install the gem in my app and run script/generate conductor_migration i says it cant find the migration.

Any thoughts?

Turns out it's a bug in bundler for 2.3.8. I received a note from them yesterday saying that you can't access generators in gems that are local with bundler in 2.3.X you need to install them from the server. Lovely.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM