# Rake db:migrate - error 'tSYMBEG'

**URL:** <https://www.ruby-forum.com/t/rake-db-migrate-error-tsymbeg/85846>\
**Category:** Rails\
**Created:** [February 16, 2007, 7:08pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-error-tsymbeg/85846 "2007-02-16T19:08:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpigford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jpigford](https://www.ruby-forum.com/u/jpigford)\
**Post date:** [February 16, 2007, 7:08pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-error-tsymbeg/85846/1 "2007-02-16T19:08:43Z")

</div>

I’m going through the ‘Depot’ project in “Agile Web D. with  
Rails”. I just made the 003\_add\_test\_data.rb file and when I do a “rake  
db:migrate”, I get this error and I can’t figure out what is wrong:

rake aborted!  
./db/migrate//003\_add\_test\_data.rb:5: parse error, unexpected tSYMBEG  
5. :description =\>

(and the ‘d’ in description has a little arrow below it pointing up)

---

<div class="post-metadata">

**Author:** ![jpigford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jpigford](https://www.ruby-forum.com/u/jpigford)\
**Post date:** [February 16, 2007, 7:21pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-error-tsymbeg/85846/2 "2007-02-16T19:21:44Z")

</div>

Josh Josh wrote:

> rake aborted!  
> ./db/migrate//003\_add\_test\_data.rb:5: parse error, unexpected tSYMBEG  
> 5. :description =\>
> 
> (and the ‘d’ in description has a little arrow below it pointing up)

Welcome to how Ruby displays syntax errors. The language is so  
flexible that it provides confusing diagnostics. This is why I compile  
and test after only a few edits.

Post your whole file. Something on the line before this one left the  
parser not expecting a symbol.

–  
Phlip  
[http://c2.com/cgi/wiki?ZeekLand](http://c2.com/cgi/wiki?ZeekLand) ← NOT a blog!!

---

<div class="post-metadata">

**Author:** ![jpigford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jpigford](https://www.ruby-forum.com/u/jpigford)\
**Post date:** [February 16, 2007, 7:34pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-error-tsymbeg/85846/3 "2007-02-16T19:34:04Z")

</div>

Phlip wrote:

> Josh Josh wrote:
> 
> > rake aborted!  
> > ./db/migrate//003\_add\_test\_data.rb:5: parse error, unexpected tSYMBEG  
> > 5. :description =\>
> > 
> > (and the ‘d’ in description has a little arrow below it pointing up)
> 
> Welcome to how Ruby displays syntax errors. The language is so  
> flexible that it provides confusing diagnostics. This is why I compile  
> and test after only a few edits.
> 
> Post your whole file. Something on the line before this one left the  
> parser not expecting a symbol.
> 
> –  
> Phlip  
> [http://c2.com/cgi/wiki?ZeekLand](http://c2.com/cgi/wiki?ZeekLand) ← NOT a blog!!

Ok, here’s the whole file:

```auto
class AddTestData < ActiveRecord::Migration
   2. def self.up
   3. products = []
   4. products << {:title => 'Pragmatic Project Automation',
   5. :description =>
   6. %{<p>
   7. <em>Pragmatic Project Automation</em> shows you how to 
improve the
   8. consistency and repeatability of your project's procedures 
using
   9. automation to reduce risk and errors.
  10. </p>
  11. <p>
  12. Simply put, we're going to put this thing called a 
computer to work
  13. for you doing the mundane (but important) project stuff. 
That means
  14. you'll have more time and energy to do the really
  15. exciting---and difficult---stuff, like writing quality 
code.
  16. </p>},
  17. :image_url => '/images/auto.jpg',
  18. :price => 29.95 }
  19.
  20. products << {:title => 'Pragmatic Version Control',
  21. :description =>
  22. %{<p>
  23. This book is a recipe-based approach to using Subversion 
that will
  24. get you up and running quickly---and correctly. All 
projects need
  25. version control: it's a foundational piece of any 
project's
  26. infrastructure. Yet half of all project teams in the U.S. 
don't use
  27. any version control at all. Many others don't use it 
well, and end
  28. up experiencing time-consuming problems.
  29. </p>},
  30. :image_url => '/images/svn.jpg',
  31. :price => 28.50}
  32.
  33. products << {:title => 'Pragmatic Unit Testing (C#)',
  34. :description =>
  35. %{<p>
  36. Pragmatic programmers use feedback to drive their 
development and
  37. personal processes. The most valuable feedback you can get 
while
  38. coding comes from unit testing.
  39. </p>
  40. <p>
  41. Without good tests in place, coding can become a 
frustrating game of
  42. "whack-a-mole." That's the carnival game where the player 
strikes at a
  43. mechanical mole; it retreats and another mole pops up on 
the opposite side
  44. of the field. The moles pop up and down so fast that you 
end up flailing
  45. your mallet helplessly as the moles continue to pop up 
where you least
  46. expect them.
  47. </p>},
  48. :image_url => '/images/utc.jpg',
  49. :price => 27.75}
  50. products.each do |p|
  51. product = Product.create(p)
  52. raise product.errors.inspect unless product.valid?
  53. end
  54. end
  55.
  56. def self.down
  57. Product.delete_all
  58. end
  59. end
```

---

<div class="post-metadata">

**Author:** ![jpigford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jpigford](https://www.ruby-forum.com/u/jpigford)\
**Post date:** [February 16, 2007, 7:40pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-error-tsymbeg/85846/4 "2007-02-16T19:40:15Z")

</div>

Ok… I’m an idiot. When I had copied code from somewhere, it copied in  
the line numbers, and it looked normal to me, but it wasn’t in my editor  
obviously.

---

<div class="post-metadata">

**Author:** ![jpigford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jpigford](https://www.ruby-forum.com/u/jpigford)\
**Post date:** [February 17, 2007, 4:06pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-error-tsymbeg/85846/5 "2007-02-17T16:06:37Z")

</div>

You might have successfully migrated up as far as you can. When you’re  
all  
migrated up, rake db:migrate does that.

RSL

---

<div class="post-metadata">

**Author:** ![jpigford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jpigford](https://www.ruby-forum.com/u/jpigford)\
**Post date:** [February 16, 2007, 8:04pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-error-tsymbeg/85846/6 "2007-02-16T20:04:39Z")

</div>

Now that I’m not getting that error, the “rake db:migrate” command  
doesn’t seem to do anything at all… Nothing is input into the  
database at all. Here is what I get when I type in “rake db:migrate”

(in C:/InstantRails/rails\_apps/work/depot)

And then it returns me to the command prompt. Any idea why it isn’t  
doing anything at all?
