4

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?

0

2 Answers 2

18

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.

-1

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

2
  • Getting this as well - any way to fix this rather than use the console? Commented Oct 21, 2013 at 13:15
  • No, and I haven't checked if this is a known bug for RubyMine.
    – Radu Grama
    Commented Oct 23, 2013 at 10:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.