當我去我的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 –
請參閱我的答案的更新。 –