title: Rails 4.0.1 on Heroku, can't create database
body: <p>I can't get rake db:migrate to run on my rails 4.0.1 app on Heroku.</p>
  
  <p>I'm guessing that I don't have postgres configured properly... but reading the docs on heroku hasn't really helped and I'm not sure what to do. I don't know too much about heroku or postgres.</p>
  
  <p>Any help or resources would be greatly appreciated. Let me know if there's anything else I can post.</p>
  
  <p>(Also, I'm using devise, if that matters)</p>
  
  <p>When I run <code>heroku run rake db:migrate</code> I get this:</p>
  
  <pre><code>Running `rake db:migrate` attached to terminal... up, run.5077
  PG::UndefinedTable: ERROR:  relation "users" does not exist
  LINE 5:                WHERE a.attrelid = '"users"'::regclass
                                        ^
  :               SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                   pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
              FROM pg_attribute a LEFT JOIN pg_attrdef d
                ON a.attrelid = d.adrelid AND a.attnum = d.adnum
             WHERE a.attrelid = '"users"'::regclass
               AND a.attnum &gt; 0 AND NOT a.attisdropped
             ORDER BY a.attnum
  
  rake aborted!
  PG::UndefinedTable: ERROR:  relation "users" does not exist
  LINE 5:                WHERE a.attrelid = '"users"'::regclass
                                        ^
  :               SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                   pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
              FROM pg_attribute a LEFT JOIN pg_attrdef d
                ON a.attrelid = d.adrelid AND a.attnum = d.adnum
             WHERE a.attrelid = '"users"'::regclass
               AND a.attnum &gt; 0 AND NOT a.attisdropped
             ORDER BY a.attnum
  </code></pre>
  
  <p>When I run <code>heroku run rake db:setup</code> I get this:</p>
  
  <pre><code>FATAL:  permission denied for database "postgres"
  DETAIL:  User does not have CONNECT privilege.
  
  ... stack trace ...
  
  Couldn't create database for {"adapter"=&gt;"postgresql", "username"=&gt;"aqofwrwjifcqkx", "password"=&gt;"7yqDAx1L_4HFhw7WV3PH7ZrKyM", "port"=&gt;5432, "database"=&gt;"d5dvi0pjk7dgr7", "host"=&gt;"ec2-23-21-94-137.compute-1.amazonaws.com"}
  </code></pre>
  
  <p>followed by the same PG::UndefinedTable ERROR relation 'users' does not exist</p>
  
  <p>database.yml :</p>
  
  <pre><code>development:
    adapter: sqlite3
    encoding: unicode
    database: chore_app_development
    pool: 5
  
  test:
    adapter: sqlite3
    encoding: unicode
    database: chore_app_test
    pool: 5
  
  production:
    adapter: postgresql
    database: chore_app_production
    pool: 5
    timeout: 5000
  </code></pre>
  
  <p>Gemfile:</p>
  
  <pre><code>source 'https://rubygems.org'
  ruby '2.0.0'
  
  gem 'rails', '4.0.1'
  
  # Database
  group :production do
    gem 'pg'
  end
  
  group :development, :test do
    gem 'sqlite3'
  end
  
  # Assets
  gem 'sass-rails', '~&gt; 4.0.0'
  gem 'uglifier', '&gt;= 1.3.0'
  gem 'turbolinks'
  gem 'haml-rails'
  gem 'jquery-rails'
  
  # Heroku
  gem 'rails_12factor', group: :production
  
  # Application
  gem 'devise'
  gem 'formtastic'
  
  # Testing
  gem 'factory_girl_rails'
  </code></pre>