ruby - i'm getting error in running rake db:migrate -
i had typed in cmd of ruby on rails command rails generate controller user name:string email:string once created when type in rake db:migrate shows error this: c:\sites\twinkle>rake db:migrate (in c:/sites/twinkle) == createmembers: migrating ================================================== -- create_table(:members) rake aborted! error has occurred, , later migrations canceled:
sqlite3::sqlexception: table "members" exists: create table "members" (" id" integer primary key autoincrement not null, "name" varchar(255), "email" var char(255), "created_at" datetime, "updated_at" datetime)
what should do?
this error means have table called 'members' in database. remove members
table , try again. rails can't 'overwrite' table have make new one.
you can drop table this:
$rails console
activerecord::migration.drop_table(:members)
now can run rake db:migrate
again. work now.
Comments
Post a Comment