1

rake db:migrate aborts because of a syntax error

rake aborted!
/Users/Fryed/rails/treebook/db/migrate/20121009215822_devise_create_users.rb:3: syntax error, unexpected '\n', expecting '|'
/Users/Fryed/rails/treebook/db/migrate/20121009215822_devise_create_users.rb:47: syntax error, unexpected keyword_end, expecting $end

But the corresponding lines look like this:

line 3 create_table(:users) do |t and line 47 end

Why doesn't this work, and how can I fix it?

Many thanks in advance!

Ed Fry
  • 93
  • 1
  • 6

1 Answers1

1

You're just missing a trailing |, line 3 should read:

create_table(:users) do |t|

\n means line break - so the error message basically said, "ruby saw a line break, but it was expecting another |"

Alex Peattie
  • 26,633
  • 5
  • 50
  • 52