title: Getting error in seed.rb when I do rake db:seed was aborted
body: <p>I'm trying to create some data in the seed.rb file. When I try to do the <code>rake db:seed</code> I have this error:</p>
  
  <pre><code>    $ rake db:seed
  /Users/romenigld/workspace/ebook/beginning_rails_4_3rd_edition/blog/db/seeds.rb:1: warning: encountered \r in middle of line, treated as a mere space
  rake aborted!
  SyntaxError: /Users/romenigld/workspace/ebook/beginning_rails_4_3rd_edition/blog/db/seeds.rb:1: syntax error, unexpected tCONSTANT, expecting end-of-input
  Category.create([{:name =&gt; 'Programmi...
  ...                               ^
  /Users/romenigld/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `load'
  /Users/romenigld/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `block in load'
  /Users/romenigld/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:in `load_dependency'
  /Users/romenigld/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `load'
  /Users/romenigld/.rvm/gems/ruby-2.2.3/gems/railties-4.2.5.1/lib/rails/engine.rb:547:in `load_seed'
  /Users/romenigld/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/tasks/database_tasks.rb:250:in `load_seed'
  /Users/romenigld/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/railties/databases.rake:183:in `block (2 levels) in &lt;top (required)&gt;'
  Tasks: TOP =&gt; db:seed
  (See full trace by running task with --trace)
  </code></pre>
  
  <p>My seed.rb file:</p>
  
  <pre><code>user = User.create :email =&gt; 'mary@example.com', :password =&gt; 'guessit'
  
  Category.create([{:name =&gt; 'Programming'},
                   {:name =&gt; 'Event'},
                   {:name =&gt; 'Travel'},
                   {:name =&gt; 'Music'},
                   {:name =&gt; 'TV'}])
  </code></pre>
  
  <p>My user.rb:</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    has_one :profile
    has_many :articles, -&gt; { order('published_at DESC, title ASC')},
                        :dependent =&gt; :nullify
  end
  </code></pre>
  
  <p>My category.rb:</p>
  
  <pre><code>class Category &lt; ActiveRecord::Base
    has_and_belongs_to_many :articles
  end
  </code></pre>
  
  <p>My article.rb:</p>
  
  <pre><code>class Article &lt; ActiveRecord::Base
    validates_presence_of :title, :body
  
    belongs_to :user
    has_and_belongs_to_many :categories
  
    def long_title
      "#{title} - #{published_at}"
    end
  end
  </code></pre>
  
  <p>Before I create an articles_categories:</p>
  
  <pre><code>class CreateArticlesCategories &lt; ActiveRecord::Migration
    def change
      create_table :articles_categories, :id =&gt; false do |t|
        t.references :article
        t.references :category
      end
    end
    def self.down
      drop_table :articles_categories
    end
  end
  </code></pre>
  
  <p>and create the model Category:</p>
  
  <pre><code>class CreateArticlesCategories &lt; ActiveRecord::Migration
    def change
      create_table :articles_categories, :id =&gt; false do |t|
        t.references :article
        t.references :category
      end
    end
    def self.down
      drop_table :articles_categories
    end
  end
  </code></pre>