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?

Était-ce utile?

La 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).

Autres conseils

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top