ActiveRecord::DuplicateMigrationNameError
I'm getting an ActiveRecord::DuplicateMigrationNameError during rake db:migrate
My steps are:
- Add to Gemfile:
gem 'kaminari' # required by coupons
gem 'coupons', :git => 'https://github.com/fnando/coupons.git'
bundle installrake coupons:install:migrationsrake db:migratewhich generates the following error:
rake aborted!
ActiveRecord::DuplicateMigrationNameError:
Multiple migrations have the name SetupCoupons
I only have new 1 migration file in db/migrate and none of my existing migrations have the name SetupCoupons.
Rails 4.2.6 Ruby 2.3.1p112 Bundler 1.12.5
https://github.com/fnando/coupons/pull/24 seems to fix it.
Hi @jsiragusa I followed exactly your instructions and I tried looking for lib/coupons/engine.rb, did you generate that or do I have to copy it from this repo?
I am confused because I might have installed it wrong.
@NathanielGiron the lib/coupons/engine.rb is within this gem so you'd need to clone this repo and patch.
I forked this repo which includes PR #24 merged in: https://github.com/ImprintDev/coupons. If it's useful, you can simply use that fork by specifying gem 'coupons', :git => 'https://github.com/ImprintDev/coupons.git', :branch => 'master' in your Gemfile.