mercredi 3 janvier 2018

Rails, Devise Pending Migrations Error

I tried installing devise for rails and it works fine on heroku but when I try to run my code on my local host for my dev environment I get this error saying "Migrations are pending. To resolve this issue, run: bin/rails db:migrate RAILS_ENV=development"

I also get these errors when I try to migrate, C:\Sites\coolguygear>bundle exec rake db:migrate == 20180103100327 AddDeviseToUsers: migrating ================================= -- change_table(:users) rake aborted! StandardError: An error has occurred, this and all later migrations canceled:

SQLite3::SQLException: duplicate column name: email: ALTER TABLE "users" ADD "email" varchar DEFAULT '' NOT NULL C:/Sites/coolguygear/db/migrate/20180103100327_add_devise_to_users.rb:7:in block in up' C:/Sites/coolguygear/db/migrate/20180103100327_add_devise_to_users.rb:5:inup'

Caused by: ActiveRecord::StatementInvalid: SQLite3::SQLException: duplicate column name: email: ALTER TABLE "users" ADD "email" varchar DEFAULT '' NOT NULL C:/Sites/coolguygear/db/migrate/20180103100327_add_devise_to_users.rb:7:in block in up' C:/Sites/coolguygear/db/migrate/20180103100327_add_devise_to_users.rb:5:inup'

Caused by: SQLite3::SQLException: duplicate column name: email C:/Sites/coolguygear/db/migrate/20180103100327_add_devise_to_users.rb:7:in block in up' C:/Sites/coolguygear/db/migrate/20180103100327_add_devise_to_users.rb:5:inup' Tasks: TOP => db:migrate (See full trace by running task with --trace)

      # Raises <tt>ActiveRecord::PendingMigrationError</tt> error if any migrations are pending.
  def check_pending!(connection = Base.connection)
    raise ActiveRecord::PendingMigrationError if ActiveRecord::Migrator.needs_migration?(connection)
  end

  def load_schema_if_pending!

Aucun commentaire:

Enregistrer un commentaire