$rake db:migrate An error has occurred, this and all later migrations canceled

Not sure if you are following Michael Hartl's tutorial on RoR.

But someone has said there's a problem in the steps of the tutorial http://archive.railsforum.com/viewtopic.php?id=44944

rake db:drop:all <---------- will wipe everything then run rake db:migrate again should fix the problem.

Good Luck


table "users" already exists seems to be the problem. Have you tried to manually remove the table from your database with some SQLITE admin tool?

Or you can include a remove table in your migration script (should be called create_users.rb inside your db/migrate folder). Inside def up insert drop_table :users :

      def up
         drop_table :users

         create_table :users do |t|
         t.string :name
         #...

         t.timestamps
      end

Oh and I remember from my RoR time that the table name "Users" can cause problems later on. Might be this is related.


Because the table already exists, you need to delete/remove it before executing the migration.

Easy, GUI way to do this is with the SQLite Database Browser (http://sourceforge.net/projects/sqlitebrowser/).

Click the button with the Table-X icon. Choose User Table click Delete.

Then run rake db:migrate

Bada boom bada bing