我想部署我的rails應用程序,我在動作教程中遵循Rails 4。我已經成功地推到Heroku的,但是當運行耙分貝:遷移我得到這個錯誤:PG :: Undefinedtable:錯誤:當運行rake db:在Heroku上遷移
heroku run rake db:migrate
Running rake db:migrate on ⬢ fast-lowlands-66439... up, run.6711 (Free)
ActiveRecord::SchemaMigration Load (10.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
Migrating to CreateStates (20161123222713)
(2.5ms) BEGIN
== 20161123222713 CreateStates: migrating =====================================
-- create_table(:states)
-- add_reference(:tickets, :state, {:index=>true, :foreign_key=>true})
(1.4ms) ALTER TABLE "tickets" ADD "state_id" integer
(9.7ms) CREATE INDEX "index_tickets_on_state_id" ON "tickets" ("state_id")
(4.6ms) ALTER TABLE "tickets" ADD CONSTRAINT "fk_rails_fc553dc329"
FOREIGN KEY ("state_id")
REFERENCES "states" ("id")
(0.6ms) ROLLBACK
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
PG::UndefinedTable: ERROR: relation "states" does not exist
: ALTER TABLE "tickets" ADD CONSTRAINT "fk_rails_fc553dc329"
FOREIGN KEY ("state_id")
REFERENCES "states" ("id")
的應用本地工作和表確實存在。
讓我知道你是否需要任何額外的文件發佈。 非常感謝您的幫助。