Question

Developing RoR app on Windows using RubyMine, trying to connect to Postgres database hosted on Heroku server. No Postgres installed locally. Getting "java.sql.SQLException: FATAL: no pg_hba.conf entry for host..." What to do, what to do?

Was it helpful?

Solution 2

It looks like this is a RubyMine issue. RubyMine will convert the hostname to an IP address and pg_hba.conf includes the hostname but not the IP address hence the error. It works fine from the command line (e.g. rails s).

OTHER TIPS

This is due to Heroku databases needing additional SSL configuration. You need to enable SSL in your jdbc string by appending:

?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory

For details see Heroku's help document.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top