small medium large xlarge

Generic-user-small
07 Aug 2010, 18:04
Carl Jenkins (2 posts)

Hey all -

I am using SQLLite 3 as the book uses but when I run the db:migrate command to create products scaffold I get the following. Any help getting past this would be fantastic!!

carl@carl-laptop:~/RubymineProjects/depot$ rake db:migrate (in /home/carl/RubymineProjects/depot) rake aborted! ./db/migrate//20100807175656_create_products.rb:4: syntax error, unexpected ‘:’, expecting kEND t.string : title

I have seen a couple posts here about the db:migrate but, from what I saw a different database was being used “Mysql”

Generic-user-small
07 Aug 2010, 18:22
Carl Jenkins (2 posts)

Well - I figured out what the issue was but, not sure why this is happening.

In the migration for ‘proudct’ the self.up method contains the 3 fields that will be columns in the database. The first one (t.string : title) There was a space between the colon and the word title. While the others looked fine. Once I removed the space all was running.

Any idea why this happens?

Generic-user-small
26 Aug 2010, 17:50
Rob Richey (1 post)

I am hiving this same problem. Can anyone shed some light on this? I keep getting an error about how a migration already exists.

Generic-user-small
06 Sep 2010, 15:19
Muzaffar Ariff (1 post)

Just go to the folder db/migrate/and open the migration file extension .rb. Then just remove the space like Carl said. So if it was: ‘t.string : tittle’ change it to ‘t.string :title’.

Rerun the program again and you should be ok.

You must be logged in to comment