Created
February 9, 2015 16:07
-
-
Save lopezjurip/0634262b5bb070684626 to your computer and use it in GitHub Desktop.
Dokker + Postgres, avoiding "PG::ConnectionBad: could not connect to server: Connection refused"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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