Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Duplicate Column name; email in AddingDeviseTo Users

Hello Everyone,

I have this error when adding devise. I have searched and found solutions but none seem to work for me. Here is the error and code. I have been told to remove the dupe but have not been able to do it. Any help would be greatly appreciated. Thanks!

AddDeviseToUsers: migrating =============================================== -- change_table(:users) rake aborted! An error has occurred, this and all later migrations canceled:

SQLite3::SQLException: duplicate column name: email: ALTER TABLE "users" ADD "em ail" varchar(255) DEFAULT '' NOT NULL

Tasks: TOP => db:migrate (See full trace by running task with --trace)

C:\Sites\projects\code\treebook>rake db:migrate == CreateStatuses: migrating ================================================= -- create_table(:statuses) -> 0.0040s == CreateStatuses: migrated (0.0060s) ========================================

== DeviseCreateUsers: migrating ============================================== -- create_table(:users) -> 0.0390s -- add_index(:users, :email, {:unique=>true}) -> 0.0020s -- add_index(:users, :reset_password_token, {:unique=>true}) -> 0.0010s == DeviseCreateUsers: migrated (0.0450s) =====================================

== AddUserIdToStatuses: migrating ============================================ -- add_column(:statuses, :user_id, :integer) -> 0.0020s -- add_index(:statuses, :user_id) -> 0.0010s -- remove_column(:statuses, :name) -> 0.0120s == AddUserIdToStatuses: migrated (0.0190s) ===================================

== AddDeviseToUsers: migrating =============================================== -- change_table(:users) rake aborted! An error has occurred, this and all later migrations canceled:

SQLite3::SQLException: duplicate column name: email: ALTER TABLE "users" ADD "em ail" varchar(255) DEFAULT '' NOT NULL

Tasks: TOP => db:migrate (See full trace by running task with --trace)