title: PG::UndefinedTable - Next troubleshooting step?
body: <p>I've got a Rails app that works fine in development and testing, but in production, where it is configured to use a remote Postgresql database, it is failing to create its table. The database is setup and working. I can connect to it via psql as the app, from the production server, using the same configuration that I specify in my database.yml, and then I can create and query tables with commands, no problem.</p>
  
  <p>When I execute database-related rake tasks, everything looks good:</p>
  
  <pre><code>$ rake db:reset
  -- create_table("users", {:force=&gt;true})
     -&gt; 0.0293s
  -- add_index("users", ["username"], {:name=&gt;"index_users_on_username", :unique=&gt;true})
     -&gt; 0.0428s
  -- initialize_schema_migrations_table()
     -&gt; 0.0212s
  -- create_table("users", {:force=&gt;true})
     -&gt; 0.0097s
  -- add_index("users", ["username"], {:name=&gt;"index_users_on_username", :unique=&gt;true})
     -&gt; 0.0058s
  -- initialize_schema_migrations_table()
     -&gt; 0.0092s
  </code></pre>
  
  <p>No errors. But the table has not been created.</p>
  
  <p>I discovered this by investigating the Nginx error log, but the easiest way to reproduce the error is to fire up the console and do anything with with the app's only model:</p>
  
  <pre><code>$ rails console production
  Loading production environment (Rails 4.2.0.beta4)
  2.1.3 :001 &gt; all_users = User.all
  PG::UndefinedTable: ERROR:  relation "users" does not exist
  LINE 1: SELECT "users".* FROM "users"
                            ^
  </code></pre>
  
  <p>I've also ssh'd into the database server and inspected the database  with <code>\z</code>, and it isn't there.</p>
  
  <p>I think the app is connecting to the database server properly, because earlier I was getting permissions errors, and I resolved those. But I don't know how to make sure. And if I do confirm that I am connecting properly, where do I go from there?</p>
  
  <p>Thanks!</p>