title: "no password supplied" in Rails 4 using establish_connection
body: <p>I'm having to connect to a legacy database to import data to my new system, which is not something I've done before, so I'd appreciate someone helping me understand the setting I have wrong somewhere.</p>
  
  <p>From the command line I can connect to the legacy database easily, with no password:</p>
  
  <pre><code>$ /usr/local/bin/psql -V
  psql (PostgreSQL) 9.2.4
  $ /usr/local/bin/psql -U adminuser -p 15432 legacydb
  psql (9.2.4, server 8.4.5)
  WARNING: psql version 9.2, server version 8.4.
           Some psql features might not work.
  Type "help" for help.
  
  legacydb=# select count(*) from atable;
   count 
  -------
    1005
  (1 row)
  
  legacydb=# \q
  $
  </code></pre>
  
  <p>So in my Rails app, I defined app/models/atable.rb this way:</p>
  
  <pre><code>class Atable &lt; ActiveRecord::Base
  
  establish_connection(
    :adapter =&gt; "postgresql",
    :host =&gt; "localhost",
    :port =&gt; 15432,
    :username =&gt; "adminuser",
    :database =&gt; "legacydb"
  )
  
  end
  </code></pre>
  
  <p>But when I try to retrieve something I get the no password error:</p>
  
  <pre><code>rails c
  Loading development environment (Rails 4.0.0)
  
  2.0.0-p247 :002 &gt; t = Atable.first
  PG::ConnectionBad: fe_sendauth: no password supplied
  </code></pre>
  
  <p>What's my mistake?</p>