3

I am currently following the Ruby on Rails Tutorial and I am at https://www.railstutorial.org/book/updating_and_deleting_users#sec-administrative_users Every time I run bundle exec rake db:migrate I get the following error:

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'
3
  • so what does that tell you? if your schema already has it then you have an extra migration somewhere trying to add the column. Commented Jan 8, 2015 at 3:05
  • 1
    Can you try migrating your DB to version=0 and then run "rake db:migrate" Commented Jan 8, 2015 at 8:54
  • Or go to the migration you want to run and delete line that generates remember_digest column. Commented Jan 8, 2015 at 10:05

1 Answer 1

14

try migrating your DB to version=0 with command: rake db:migrate VERSION=0

and then run rake db:migrate

Sign up to request clarification or add additional context in comments.

3 Comments

@RoryPerro this answer will help you understand better: stackoverflow.com/a/13333716/2545197
@Abhinay you should now you are awesome
DISCLAIMER - this command will delete the content of your database by remodeling from scratch the structure of your DB. I just deleted a 2 year old local development DB with thousands of datas ^^

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.