coupons icon indicating copy to clipboard operation
coupons copied to clipboard

ActiveRecord::DuplicateMigrationNameError

Open jsiragusa opened this issue 9 years ago • 3 comments

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 install
  • rake coupons:install:migrations
  • rake db:migrate which 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

jsiragusa avatar Sep 22 '16 13:09 jsiragusa

https://github.com/fnando/coupons/pull/24 seems to fix it.

jsiragusa avatar Sep 26 '16 15:09 jsiragusa

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 avatar Dec 01 '16 00:12 NathanielGiron

@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.

jsiragusa avatar Dec 01 '16 03:12 jsiragusa