title: Rails & Postgresql on AWS Cloud 9 : role "ec2-user" does not exist
body: <p>I am trying to get my Rails environment up and running with a Postgres database using AWS Cloud9 and have run into a problem when trying run <code>rails db:migrate</code>.  </p>
  
  <p>Initially I created the project by running:</p>
  
  <ol>
  <li><b>rails new app_name -d postgresql</b></li>
  <li><b>bundle install</b></li>
  </ol>
  
  <p>Bundler had a problem finding <code>gem 'pg'</code> so I ran:</p>
  
  <ol>
  <li><b>sudo yum install postgresql-devel</b></li>
  <li><b>sudo yum install postgresql-server</b></li>
  <li><b>sudo postgresql initdb</b></li>
  <li><b>sudo service postgresql start</b></li>
  </ol>
  
  <p>The server fired up fine afterwards and I thought all was well until running <code>rails db:migrate</code> which returned the error:</p>
  
  <p><b>PG::ConnectionBad: FATAL:  role "ec2-user" does not exist</b></p>
  
  <p>I am unsure how to fix this.</p>
  
  <p>It has been suggested that I may need to get into my psql shell and alter or create a new role, but I'm unsure how to alter the <code>ec2-user</code>.</p>
  
  <p>It has also been suggested that my <code>pg_hba.conf</code> file may need some alterations.  I have the path to that file, but am not sure how to edit it or if that's something that I really want to do. </p>
  
  <p>Any suggestions?  I'm including my <code>database.yml</code> below:</p>
  
  <pre><code>default: &amp;default
    adapter: postgresql
    encoding: unicode
    pool: &lt;%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %&gt;
  
  development:
    &lt;&lt;: *default
    database: my_app_development
  
  test:
    &lt;&lt;: *default
    database: my_app_test
  
  production:
    &lt;&lt;: *default
    database: my_app_production
    username: my_app
    password: &lt;%= ENV['MY_APP_DATABASE_PASSWORD'] %&gt;
  </code></pre>