title: postgresql error in Cloud9 "fe_sendauth: no password supplied"
body: <p>I'd like to setup postgresql for my rails app in <strong>Cloud9</strong>.</p>
  
  <p>Although I followed <a href="https://stackoverflow.com/questions/26545746/cloud9-postgres">the top voted answer of this post</a>, the following error appeared when I tried to <code>bundle exec rake db:create</code>.</p>
  
  <pre><code>fe_sendauth: no password supplied
  ...
  Couldn't create database for {"adapter"=&gt;"postgresql", "encoding"=&gt;"unicode", "pool"=&gt;5, "username"=&gt;nil, "password"=&gt;nil, "host"=&gt;"0.0.0.0", "database"=&gt;"app_development"}
  fe_sendauth: no password supplied
  ...
  Couldn't create database for {"adapter"=&gt;"postgresql", "encoding"=&gt;"unicode", "pool"=&gt;5, "username"=&gt;nil, "password"=&gt;nil, "host"=&gt;"0.0.0.0", "database"=&gt;"app_test"}
  </code></pre>
  
  <p><strong>database.yml</strong></p>
  
  <pre><code>default: &amp;default
    adapter: postgresql
    encoding: unicode
    pool: 5
    username: &lt;%= ENV['USERNAME'] %&gt;
    password: &lt;%= ENV['PASSWORD'] %&gt;
    host:     &lt;%= ENV['IP'] %&gt;
  
  development:
    &lt;&lt;: *default
    database: app_development
  
  test:
    &lt;&lt;: *default
    database: app_test
  
  production:
    &lt;&lt;: *default
    database: app_production
  </code></pre>
  
  <p><strong>Gemfile</strong></p>
  
  <pre><code>gem 'pg', '~&gt; 0.18.2'
  </code></pre>
  
  <p>Although I found similar questions in stackoverflow, they doesn't work for me.</p>
  
  <p>It would be appreciated if you could give me how to avoid this error.</p>
  
  <p><code>Cloud 9</code> can't allow us to access to the <code>pg_hba.conf</code> file as <a href="https://stackoverflow.com/questions/35329650/fe-sendauth-no-password-supplied-error-after-setting-up-postgresql-database-on">this post</a> mentioned.</p>
  
  <p><strong>EDIT!!!</strong></p>
  
  <p><code>host:     localhost</code> was added instead of <code>host:     &lt;%= ENV['IP'] %&gt; in "database.yml"</code></p>
  
  <p><code>sudo vim /etc/postgresql/9.3/main/pg_hba.conf</code></p>
  
  <pre><code># "local" is for Unix domain socket connections only
  local   all             xxx                                     peer
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code># "local" is for Unix domain socket connections only
  local   all             username                                     peer
  </code></pre>