title: Impossible to connect to Postgresql using RubyMine
body: <p>I've been trying to connect to <strong>PostgreSQL</strong> using <strong>RubyMine</strong> but it's always asking for a password. </p>
  
  <p>In a terminal I do connect using:</p>
  
  <pre><code>psql -U postgres
  </code></pre>
  
  <p>I don't have to input a password. </p>
  
  <p>But, when I tried using RubyMine to connect to PostgreSQL is always asking for a password. I tried input some passwords but they don't work. Any idea?</p>
  
  <p>My settings file:</p>
  
  <pre><code>default: &amp;default
    adapter: postgresql
    encoding: unicode
    # For details on connection pooling, see rails configuration guide
    # http://guides.rubyonrails.org/configuring.html#database-pooling
    pool: 5
  
  development:
    &lt;&lt;: *default
    database: portafolio_development
    username: postgres
    password:
  
  test:
    &lt;&lt;: *default
    database: portafolio_test
    username: postgres
    password:
  
  production:
    &lt;&lt;: *default
    database: portafolio_production
    username: portafolio
    password: &lt;%= ENV['PORTAFOLIO_DATABASE_PASSWORD'] %&gt;
  </code></pre>
  
  <p><strong>Edited</strong></p>
  
  <p>My <strong>pg_hba.conf</strong>:</p>
  
  <pre><code>local   all             postgres                                peer
  
  # TYPE  DATABASE        USER            ADDRESS                 METHOD
  
  # "local" is for Unix domain socket connections only
  local   all             all                                     peer
  # IPv4 local connections:
  host    all             all             127.0.0.1/32            md5
  # IPv6 local connections:
  host    all             all             ::1/128                 md5
  # Allow replication connections from localhost, by a user with the
  # replication privilege.
  #local   replication     postgres                                peer
  #host    replication     postgres        127.0.0.1/32            md5
  #host    replication     postgres        ::1/128                 md5
  </code></pre>
  
  <p><strong>Solved</strong></p>
  
  <p>Result that I have two <code>pg_hba.conf</code> files. One for version <em>9.3</em> and another for <em>9.4</em>. I changed the first one to the following and everything is working now:</p>
  
  <pre><code>local all postgres trust
  # The same using local loopback TCP/IP connections.
  #
  # TYPE  DATABASE        USER            ADDRESS                 METHOD
  host    all             all             127.0.0.1/32            trust
  
  # The same as the previous line, but using a separate netmask column
  #
  # TYPE  DATABASE        USER            IP-ADDRESS      IP-MASK             METHOD
  host    all             all             127.0.0.1       255.255.255.255     trust
  
  # The same over IPv6.
  #
  # TYPE  DATABASE        USER            ADDRESS                 METHOD
  host    all             all             ::1/128                 trust
  
  # The same using a host name (would typically cover both IPv4 and IPv6).
  #
  # TYPE  DATABASE        USER            ADDRESS                 METHOD
  host    all             all             localhost               trust
  </code></pre>