title: Error: Relation does not exist when running Rails in production using postgresql
body: <p>I'm having a problem with my application on Heroku, and in order to determine whether it is specific to my production environment or specific to Heroku itself I am running my production environment locally on my machine with rails s -e production</p>
  
  <p>When I try to load my posts index, I get the following error:</p>
  
  <pre><code>PG::UndefinedTable: ERROR:  relation "posts" does not exist
  LINE 1: SELECT "posts".* FROM "posts"
                            ^
  : SELECT "posts".* FROM "posts"
  PG::UndefinedTable: ERROR:  relation "posts" does not exist
  LINE 1: SELECT "posts".* FROM "posts"
  </code></pre>
  
  <p>What's weird is my posts index works fine on Heroku, as well as in development and in test. When I run bundle exec rake db:create:all I get the follow output:</p>
  
  <pre><code>project_development already exists
  project_test already exists
  project_production already exists
  </code></pre>
  
  <p>My schema is as follows:</p>
  
  <pre><code>create_table "posts", force: true do |t|
    t.string   "title"
    t.text     "body"
    t.datetime "created_at"
    t.datetime "updated_at"
    t.integer  "author_id"
    t.boolean  "published"
  end
  </code></pre>
  
  <p>When I fire up rails db in the command line, I can see the table as expected when I run \dt:</p>
  
  <pre><code> public | posts             | table | Thomas
  </code></pre>
  
  <p>However when I fire it up with ENV=production and run \dt I get the following:</p>
  
  <pre><code>Schema |       Name        | Type  | Owner  
  --------+-------------------+-------+--------
  public | schema_migrations | table | Thomas
  </code></pre>
  
  <p>I've tried running ENV=production rake db:schema:load and that does not solve the problem. </p>
  
  <p>For reference, here is my database.yaml:</p>
  
  <pre><code>development:
    adapter: postgresql
    encoding: utf8
    database: project_development
    pool: 5
    username:
    password:
  
  test:
    adapter: postgresql
    encoding: utf8
    database: project_test
    pool: 5
    username:
    password:
  
  production:
    adapter: postgresql
    encoding: utf8
    database: project_production
    pool: 5
    username:
    password:
  </code></pre>