title: bundle exec rake db:populate - activerecord::recordinvalid:validation failed:email has already been taken
body: <p>I am currently at chapter 10 of michael hartl's tutorial and there is a problem when i try to do bundle exec rake db:populate. </p>
  
  <p>Attached is the error message:</p>
  
  <pre><code>rake aborted!                                                                                                                        
  ActiveRecord::RecordInvalid: Validation failed: Email has already been taken                                                         
  /home/action/.gem/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/validations.rb:57:in `save!'                                  
  /home/action/.gem/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/attribute_methods/dirty.rb:29:in `save!'                      
  /home/action/.gem/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/transactions.rb:273:in `block in save!'                       
  /home/action/.gem/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/transactions.rb:329:in `block in with_transaction_returning_st
  atus'                                                                                                                                
  /home/action/.gem/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `bl
  ock in transaction'                                                                                                                  
  /home/action/.gem/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:219:in `wi
  thin_new_transaction'                                                                                                                
  /home/action/.gem/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `tr
  ansaction'                                                                                                                           
  /home/action/.gem/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/transactions.rb:208:in `transaction'                          
  /home/action/.gem/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/transactions.rb:326:in `with_transaction_returning_status'    
  /home/action/.gem/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/transactions.rb:273:in `save!'                                
  /home/action/.gem/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/validations.rb:41:in `create!'                                
  /home/action/workspace/app3/lib/tasks/sample_data.rake:4:in `block (2 levels) in &lt;top (required)&gt;'                                   
  Tasks: TOP =&gt; db:populate                                                                                                            
  (See full trace by running task with --trace)    
  </code></pre>
  
  <p>Attached is the sample_data.rake file:</p>
  
  <pre><code>namespace :db do
    desc "Fill database with sample data"
    task populate: :environment do
      admin = User.create!(name: "Example User",
                           email: "example@railstutorial.org",
                           password: "foobar",
                           password_confirmation: "foobar",
                           admin: true)
      User.create!(name: "Example User",
                   email: "example@railstutorial.org",
                   password: "foobar",
                   password_confirmation: "foobar")
      99.times do |n|
        name  = Faker::Name.name
        email = "example-#{n+1}@railstutorial.org"
        password  = "password"
        User.create!(name: name,
                     email: email,
                     password: password,
                     password_confirmation: password)
        users = User.all(limit: 6)
        50.times do
          content = Faker::Lorem.sentence(5)
          users.each { |user| user.microposts.create!(content: content) }
        end
      end
    end
  end
  </code></pre>