Reputation: 205
Whenever I create and run a new migration, my earliest migration automatically starts executing and gives me the following error:- "rake aborted! An error has occurred, all later migrations canceled: Mysql2::Error: Table 'xyz' already exists" Due to the this error my rake db:migrate does not run and rather I have to use rake db:migrate:up VERSION=123xyz for my new migration. What shall I do to remove this error , so that my previous miration doesn't run everytime.
Upvotes: 1
Views: 478
Reputation: 2135
Try checking if your Gemfile is updated. See Listing 1.18 (scroll above to see the same a similar error message the author addresses):
http://ruby.railstutorial.org/chapters/beginning#code:gemfile_sqlite_heroku
Inside the GemFile:
source 'http://rubygems.org'
gem 'rails', '3.0.5'
gem 'sqlite3-ruby', '1.3.2', :group => :development
Upvotes: 0