title: Hartl Rails5 tutorial 6.3 Can't create user through terminal or seeds.rb
body: <p>I'm working through <a href="https://www.railstutorial.org/book/modeling_users" rel="nofollow noreferrer">Hartl's rails tutorial</a> and I'm stuck on the end of chapter 6 where I'm supposed to create a user in the rails console.  It won't save to my database.</p>
  
  <p>This is what I type into the console:</p>
  
  <blockquote>
    <p>User.create(name: "Michael Hartl", email: "mhartl@example.com", password: "foobar", password_confirmation: "foobar")</p>
  </blockquote>
  
  <p>console output:</p>
  
  <blockquote>
    <p>(0.1ms)  begin transaction
      User Exists (0.8ms)  SELECT  1 AS one FROM "users" WHERE LOWER("users"."email") = LOWER(?) LIMIT ?  [["email", "mhartl@example.com"], ["LIMIT", 1]]
       (0.1ms)  rollback transaction
    => #</p>
  </blockquote>
  
  <p>I don't know why it says <code>User Exists</code> because the User table is empty.</p>
  
  <p>app/models/user.rb</p>
  
  <pre><code>class User &lt; ApplicationRecord
    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 }
  
  end
  </code></pre>