Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Dokker + Postgres, avoiding "PG::ConnectionBad: could not connect to server: Connection refused"
# Create database, save Url for later use, let's call it <saved_url>
dokku postgresql:create <database>
# Link
dokku postgresql:link <app_name> <database>
# Check db url
dokku config <app_name> | grep DATABASE_URL
# if saved url is not equals to the last displayed, then:
dokku config:set <app_name> DATABASE_URL=<saved_url>
# Migrate
dokku run <app_name> bundle exec rake db:migrate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment