I'm trying to connect my Heroku App to an outside PostgreSQL. But I keep getting a connection refused error:
ActionView::Template::Error (could not connect to server: Connection refused
2018-08-30T12:44:46.868880+00:00 app[web.1]: Is the server running on host "localhost" (127.0.0.1) and accepting
2018-08-30T12:44:46.868882+00:00 app[web.1]: TCP/IP connections on port 5432?
In my Heroku Admin I've set my DATABASE_URL to point to my PostgreSQL (No password)
DATABASE_URL postgres://postgres:@localhost:5432/postgres
My database.yml looks like this
default: &default
adapter: postgresql
encoding: unicode
# For details on connection pooling, see Rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
production:
<<: *default
url: <%= ENV['DATABASE_URL'] %>
When I enter the command Heroku config I can definitely see my DATABASE_URL. What is the issue here?