heroku

This living document provides a list of useful snippets reagarding working with Heroku as well as so guidance for problems I faced myself and and want to be able to solve faster the next time I encounter them.

Content

Basic Resources

Situations

Deploying a rails app with pending migrations

Remember that heroku does not run database migration for raisl applications automatically whil deploying (at least, not by default). You might encounter errors in the deployed version that are due to missing database migrations. To run migrations from the CLI: heroku run rails db:migrate --app your-heroku-application-name1 Afterwards, you app still might be not functioning correct, because it is in a transient state, database-wise. Usually, a restart of the app should fix this. To restart the app, go to the web interface or run heroku ps:restart --app your-heroku-application-name.

Deploying to heroku with an existing app and soruce code cloned from github

It really is as simple as adding heroku to the repositories remotes: heroku git:remote --app your-heroku-application-name. You can verify this by running git remote -v:

heroku    https://git.heroku.com/your-heroku-application-name.git (fetch)
heroku    https://git.heroku.com/your-heroku-application-name.git (push)
origin    git@github.com:user/repository.git (fetch)
origin    git@github.com:user/repository.git (push)

Resources

  • This Stack Overlow Question

1: Make sure you use the Heroku name of your application, not the one that you ight have used on your local filesystem. If you are not sure what the app name is, check the Heroku Web-Interface or run heroku apps

Last updated