我剛剛安裝了Heroku,並試圖讓我的應用程序在其上運行。Heroku未定義表錯誤
我得到這個錯誤
2016-01-06T11:27:26.741740+00:00 app[web.1]: => Rails 4.2.0 application starting in production on http://0.0.0.0:47038
2016-01-06T11:27:26.741741+00:00 app[web.1]: => Run `rails server -h` for more startup options
2016-01-06T11:27:26.741741+00:00 app[web.1]: => Ctrl-C to shutdown server
2016-01-06T11:27:26.741742+00:00 app[web.1]: Started GET "/" for 122.104.136.142 at 2016-01-06 11:27:26 +0000
2016-01-06T11:27:26.800681+00:00 app[web.1]: Processing by ProductsController#home as HTML
2016-01-06T11:27:26.819306+00:00 app[web.1]: Product Load (1.5ms) SELECT "products".* FROM "products" LIMIT 30 OFFSET 0
2016-01-06T11:27:26.819330+00:00 app[web.1]: PG::UndefinedTable: ERROR: relation "products" does not exist
2016-01-06T11:27:26.819331+00:00 app[web.1]: LINE 1: SELECT "products".* FROM "products" LIMIT 30 OFFSET 0
2016-01-06T11:27:26.819332+00:00 app[web.1]: ^
2016-01-06T11:27:26.819332+00:00 app[web.1]: : SELECT "products".* FROM "products" LIMIT 30 OFFSET 0
2016-01-06T11:27:26.819793+00:00 app[web.1]: Rendered products/_product_display.html.erb (5.4ms)
2016-01-06T11:27:26.819862+00:00 app[web.1]: Rendered products/home.html.erb within layouts/application (7.9ms)
2016-01-06T11:27:26.819966+00:00 app[web.1]: Completed 500 Internal Server Error in 19ms
我知道我的移民填滿,如果我刪除數據庫我不能沒有在本地得到同樣的錯誤運行rake db:migrate
。所以爲了讓他們工作我運行rake db:drop
然後rake db:create
然後rake db:schema:load
。它加載架構和rake db:migrate
作品。
有沒有辦法像Heroku一樣在Heroku中加載架構?或者任何其他方式來使這個工作?