title: uninitialized constant ApplicationRecord
body: <p>I am working on the rails tutorial book online and I am getting the following error message when I go to <a href="http://localhost:3000/" rel="noreferrer">http://localhost:3000/</a> </p>
  
  <blockquote>
    <p>"uninitialized constant ApplicationRecord"</p>
  </blockquote>
  
  <p>and it gives me the following code highlighting the first line. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>class User &lt; ApplicationRecord
    attr_accessor :remember_token
    before_save { self.email = email.downcase }
    validates :name,  presence: true, length: { maximum: 50 }
    VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
    validates :email, presence: true, length: { maximum: 255 },</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here is my application.html.erb file:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;&lt;%= full_title(yield(:title)) %&gt;&lt;/title&gt;
      &lt;%= stylesheet_link_tag "application", media: "all",
                                             "data-turbolinks-track" =&gt; true %&gt;
      &lt;%= javascript_include_tag "application", "data-turbolinks-track" =&gt; true %&gt;
      &lt;%= csrf_meta_tags %&gt;
      &lt;%= render 'layouts/shim' %&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;%= render 'layouts/header' %&gt;
      &lt;div class="container"&gt;
        &lt;% flash.each do |message_type, message| %&gt;
          &lt;div class="alert alert-&lt;%= message_type %&gt;"&gt;&lt;%= message %&gt;&lt;/div&gt;
        &lt;% end %&gt;
        &lt;%= yield %&gt;
        &lt;%= render 'layouts/footer' %&gt;
        &lt;%= debug(params) if Rails.env.development? %&gt;
      &lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>And my user.rb file :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>class User &lt; ApplicationRecord
    attr_accessor :remember_token
    before_save { self.email = email.downcase }
    validates :name,  presence: true, length: { maximum: 50 }
    VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
    validates :email, presence: true, length: { maximum: 255 },
                      format: { with: VALID_EMAIL_REGEX },
                      uniqueness: { case_sensitive: false }
    has_secure_password
    validates :password, presence: true, length: { minimum: 6 }
  
    # Returns the hash digest of the given string.
    def User.digest(string)
      cost = ActiveModel::SecurePassword.min_cost ? BCrypt::Engine::MIN_COST :
                                                    BCrypt::Engine.cost
      BCrypt::Password.create(string, cost: cost)
    end
  
    # Returns a random token.
    def User.new_token
      SecureRandom.urlsafe_base64
    end
  
    # Remembers a user in the database for use in persistent sessions.
    def remember
      self.remember_token = User.new_token
      update_attribute(:remember_digest, User.digest(remember_token))
    end
  
    # Returns true if the given token matches the digest.
    def authenticated?(remember_token)
      return false if remember_digest.nil?
      BCrypt::Password.new(remember_digest).is_password?(remember_token)
    end
  
    # Forgets a user.
    def forget
      update_attribute(:remember_digest, nil)
    end
  end</code></pre>
  </div>
  </div>
  </p>