SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Mar 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error in 'Simply Rails 2' running migrate on p. 132

    Hi,

    I'm looking for some help. I'm on page 132 and trying to run the rake db:migrate command but get an error reading:

    (in /Users/burtherman/shovell)
    rake aborted!
    ./db/migrate//20090308204748_create_stories.rb:3: syntax error, unexpected ':', expecting kEND
    create_table :stories :force => true do |t|
    ^
    ./db/migrate//20090308204748_create_stories.rb:4: syntax error, unexpected tSYMBEG, expecting kEND
    t.string :name
    ^
    ./db/migrate//20090308204748_create_stories.rb:14: syntax error, unexpected kEND, expecting $end

    Any ideas on how to fix this?

    Thanks!

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,174
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)
    Hi burtherman, welcome to the forums,

    I know error messages can be a bit cryptic, overwhelming, and confusing until you get used to them, but they point you to the problem.

    The migration file in chapter 5 looks like
    Code Ruby:
    class CreateStories < ActiveRecord::Migration
      def self.up
        create_table :stories, :force => true do |t|
          t.string :name
          t.string :link
     
          t.timestamps
        end
      end
     
      def self.down
        drop_table :stories
      end
    end
    Notice the comma between :stories and :force

  3. #3
    SitePoint Member
    Join Date
    Mar 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, that indeed did the trick!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •