fnando / coupons

Coupons is a Rails engine for creating discount coupons.
MIT License
141 stars 113 forks source link

ActiveRecord::DuplicateMigrationNameError #23

Open jsiragusa opened 8 years ago

jsiragusa commented 8 years ago

I'm getting an ActiveRecord::DuplicateMigrationNameError during rake db:migrate

My steps are:

gem 'kaminari' # required by coupons
gem 'coupons', :git => 'https://github.com/fnando/coupons.git'
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 commented 8 years ago

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

NathanielGiron commented 7 years ago

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.

jsiragusa commented 7 years ago

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