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.
在mysql控制台中手动删除该表
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
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.