title: Getting error while trying to view Heroku app
body: <p>I'm new to using Rails as well as Heroku and have been trying to push an app that works just fine locally. I am able to push it to heroku (seemingly), but when I try to view it, I get </p>
  
  <pre><code>ActionView::Template::Error (PG::UndefinedTable: ERROR:  relation "users" does not exist
  </code></pre>
  
  <p>I from digging through similar SO post, I think it has something to do with the database the app is using within heroku but so far using <code>heroku run rake db:reset</code> and then <code>heroku run rake db:migrate</code> has returned the exact same error. I'm sure I have done something terribly misguided here but I am hoping someone can help me figure it out. Here's what I get with <code>heroku logs</code>:</p>
  
  <pre><code>2017-01-26T05:24:34.232181+00:00 app[web.1]: I, [2017-01-26T05:24:34.232138 #4]  INFO -- : [7baf7e95-1518-4773-9f3c-39aef34651f2] Completed 500 Internal Server Error in 7ms (ActiveRecord: 1.8ms)
  2017-01-26T05:24:34.233452+00:00 app[web.1]: F, [2017-01-26T05:24:34.233406 #4] FATAL -- : [7baf7e95-1518-4773-9f3c-39aef34651f2]   
  2017-01-26T05:24:34.233498+00:00 app[web.1]: F, [2017-01-26T05:24:34.233455 #4] FATAL -- : [7baf7e95-1518-4773-9f3c-39aef34651f2] ActionView::Template::Error (PG::UndefinedTable: ERROR:  relation "users" does not exist
  2017-01-26T05:24:34.233500+00:00 app[web.1]: LINE 1: SELECT  "users".* FROM "users" WHERE "users"."id" IS NULL LI...
  2017-01-26T05:24:34.233501+00:00 app[web.1]:                                ^
  2017-01-26T05:24:34.233501+00:00 app[web.1]: : SELECT  "users".* FROM "users" WHERE "users"."id" IS NULL LIMIT $1):
  2017-01-26T05:24:34.233649+00:00 app[web.1]: [7baf7e95-1518-4773-9f3c-39aef34651f2]     21:       &lt;div class="container"&gt;
  2017-01-26T05:24:34.233648+00:00 app[web.1]: F, [2017-01-26T05:24:34.233606 #4] FATAL -- : [7baf7e95-1518-4773-9f3c-39aef34651f2]     20:     &lt;div class="header"&gt;
  2017-01-26T05:24:34.233650+00:00 app[web.1]: [7baf7e95-1518-4773-9f3c-39aef34651f2]     22:         &lt;a href="../messages"&gt;&lt;h1 class="logo"&gt;MessagesApp&lt;/h1&gt; &lt;img class="logo-img" src="http://vignette2.wikia.nocookie.net/titanfall/images/3/3a/Icon_Chat.png/revision/latest?cb=20140504182858"&gt;&lt;/a&gt;
  2017-01-26T05:24:34.233650+00:00 app[web.1]: [7baf7e95-1518-4773-9f3c-39aef34651f2]     23:           &lt;% if logged_in? %&gt;
  2017-01-26T05:24:34.233651+00:00 app[web.1]: [7baf7e95-1518-4773-9f3c-39aef34651f2]     24:             &lt;%= link_to "Log out".html_safe, logout_path, method: "delete", class: "login-btn btn btn-default navbar-btn" %&gt;
  2017-01-26T05:24:34.233652+00:00 app[web.1]: [7baf7e95-1518-4773-9f3c-39aef34651f2]     25:           &lt;% else %&gt;
  2017-01-26T05:24:34.233652+00:00 app[web.1]: [7baf7e95-1518-4773-9f3c-39aef34651f2]     26:             &lt;%= link_to "Log in".html_safe, login_path, class: "login-btn btn btn-default navbar-btn" %&gt;
  2017-01-26T05:24:34.233692+00:00 app[web.1]: F, [2017-01-26T05:24:34.233648 #4] FATAL -- : [7baf7e95-1518-4773-9f3c-39aef34651f2]   
  2017-01-26T05:24:34.233718+00:00 app[web.1]: F, [2017-01-26T05:24:34.233685 #4] FATAL -- : [7baf7e95-1518-4773-9f3c-39aef34651f2] app/helpers/sessions_helper.rb:7:in `current_user'
  2017-01-26T05:24:34.233718+00:00 app[web.1]: [7baf7e95-1518-4773-9f3c-39aef34651f2] app/helpers/sessions_helper.rb:11:in `logged_in?'
  2017-01-26T05:24:34.233719+00:00 app[web.1]: [7baf7e95-1518-4773-9f3c-39aef34651f2] app/views/layouts/application.html.erb:23:in `_app_views_layouts_application_html_erb__1527317900822670125_70088753231660'
  2017-01-26T05:24:34.240424+00:00 heroku[router]: at=info method=GET path="/" host=nameless-bayou-71899.herokuapp.com request_id=7baf7e95-1518-4773-9f3c-39aef34651f2 fwd="207.67.119.130" dyno=web.1 connect=1ms service=12ms status=500 bytes=1733
  </code></pre>
  
  <p>here is what I believe is relevant code:</p>
  
  <pre><code>&lt;% @messages.each do |message| %&gt;
      &lt;div class="message &lt;%= 'right' if logged_in? &amp;&amp; message.user_id==current_user.id %&gt;"&gt;
  
        &lt;% if message.user_id==current_user.id %&gt;
          &lt;%= '&lt;p class="user_name text-right"&gt;Me&lt;/p&gt;'.html_safe %&gt;
        &lt;% else %&gt;
          &lt;p class="user_name"&gt;&lt;%= message.user.name %&gt;&lt;/p&gt;
        &lt;% end %&gt;
  
      &lt;p class="content"&gt;&lt;%= message.content %&gt;&lt;/p&gt;
      &lt;p class="time &lt;%= 'right' if message.user_id==current_user.id %&gt;"&gt;&lt;%= time_ago_in_words(message.created_at) %&gt;&lt;br&gt;
        &lt;% if message.user_id==current_user.id %&gt;
          &lt;%= link_to 'Delete', message_path(message),
              class: "delete-link",
                method: :delete,
                data: { confirm: 'Are you sure?' } %&gt;&lt;/p&gt;
        &lt;% end %&gt;
      &lt;/div&gt;
        &lt;% end %&gt;
  </code></pre>