我設法通過 Heroku 成功部署了我的 Rails 應用程式,但它似乎只能部分作業,即 root_path、about_path 和 login_path 都可以作業,但其他任何事情都會給我“我們很抱歉,但出了點問題。 ”錯誤。該應用程式可以在本地完全運行,但是沒有問題。
該應用程式在該應用程式的 Github 頁面的提交6315941上運行良好,我在提交f32ccf00上重新部署,然后應用程式停止滿負荷作業。建議/解決方案贊賞。
Started GET "/users" for
Processing by UsersController#index as HTML
Rendered users/index.html.erb within layouts/application (Duration: 2.0ms | Allocations: 318)
Rendered layout layouts/application.html.erb (Duration: 2.1ms | Allocations: 344)
Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.0ms | Allocations: 829)
ActionView::Template::Error (PG::UndefinedTable: ERROR: relation "users" does not exist
Heroku
Github
uj5u.com熱心網友回復:
聽起來您可能沒有在 Heroku 上運行資料庫遷移?默認部署程序不會自動運行它們。
heroku run rake db:migrate -a <your app>
接著
heroku ps:restart -a <your app>
因為在生產模式下,Rails 只會在啟動階段檢測架構更改。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/507287.html
