SQLite3 :: SQLException:迁移时重复的列名

时间:2015-01-07 23:47:06

标签: ruby-on-rails ruby sqlite railstutorial.org

我目前正在关注Ruby on Rails教程,我在https://www.railstutorial.org/book/updating_and_deleting_users#sec-administrative_users每次运行bundle exec rake db:migrate时都会出现以下错误:

SQLite3::SQLException: duplicate column name: remember_digest: ALTER TABLE "users" ADD   "remember_digest" varchar/home/mclacs14/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/sqlite3-1.3.9/lib/sqlite3/database.rb:91:in `initialize'

1 个答案:

答案 0 :(得分:12)

尝试将数据库迁移到version = 0 使用命令:rake db:migrate VERSION=0

然后运行 rake db:migrate