当我去我的http://localhost:3000/我得到以下几点:的Rails:迁移错误
ActiveRecord::PendingMigrationError
Migrations are pending. To resolve this issue, run: bin/rails db:migrate RAILS_ENV=development
提取的源:
# 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!
此外,当我在控制台试图向heroku run rake db:migrate
,它说:
StandardError: An error has occurred, this and all later migrations canceled: PG::DuplicateColumn: ERROR: column "email" of relation "users" already exists
我是新来的红宝石,并按照devise tutorial由Mac肯齐孩子。这是我完成我的第一个Ruby应用程序的最后一步。
我很高兴,期待你的帮助! :)
我试过了,并且在rake db:migrate后仍然出现错误,如下所示: rake aborted! StandardError的:发生错误,这和所有后来迁移取消: 的SQLite3 ::的SQLException:重复列名:encrypted_password:ALTER TABLE “用户” ADD “encrypted_password” VARCHAR DEFAULT '' NOT NULL /用户/ matthiascordes /。 rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:91:in'initialize' /Users/matthiascordes/.rvm/gems/ruby-2.3.1/gems /sqlite3-1.3.11/lib/sqlite3/database.rb:91:in'new' ...等 –
也是这个,而不是:SQLite3 :: SQLException:没有这样的表:users:ALTER TABLE“users”ADD“encrypted_password”varchar DEFAULT''NOT NULL –
请参阅我的答案的更新。 –