I am not a postgres user, but this should work. You can modify database.yml to include host and port
production: adapter: postgresql encoding: unicode database: di_production pool: 5 username: user password: host: heroku.host.name port: <postgres listen port>
And, of course, you must enable server-side connectivity, both at the firewall and database levels.
Simple hack content #{Rails.root}/config/database.yml - this is to write code to load this yml into an object and then print it in the user interface
DB_CONFIG = YAML.load(File.read("#{Rails.root}/config/database.yml", __FILE__)) puts DB_CONFIG["production"].inspect
source share