Search code examples
ruby-on-railsheroku

Rails app not working fully through Heroku deployment


I managed to successfully deploy my Rails app through Heroku, but it seems to work only partially, i.e. the root_path, about_path, and login_path all work, but anything else gives me the "We're sorry, but something went wrong." error. The app works in its entirety locally, however, without issue.

The app was working fine on commit 6315941 of the Github page for the app, and I redeployed on commit f32ccf00, which is then the app stopped working to full capacity. Advice/solutions appreciated.

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


Solution

  • It sounds like you may have not run your database migrations on Heroku? They are not run automatically by the default deploy process.

    heroku run rake db:migrate -a <your app>

    and then

    heroku ps:restart -a <your app>

    because in production mode Rails will only detect schema changes during the boot phase.