2012-01-14 136 views
0

我在使用mysql迁移数据库时遇到了问题,并决定将整个事情从水中移出并使用postgres。我已经将它与数据库一起正确安装,但现在我得到了与我使用mysql时相同的错误。rake在rake数据库后迁移db:migrate

$ rake db:migrate 
rake aborted! 
/Users/beach180/rails_projects/app/db/migrate/20120114221528_create_users.rb:6: syntax   error, unexpected ':', expecting keyword_end 
    t.string "email" :default => "", :null => false 

这是RB文件

class CreateUsers < ActiveRecord::Migration 
    def up 
    create_table :users do |t| 
     t.string "first_name", :limit => 25 
     t.string "last_name", :limit => 50 
     t.string "email" :default => "", :null => false 
     t.string "password", :limit => 40 
     t.timestamps 
    end 
    end 

    def down 
    drop_table :users 
    end 
end 

有什么想法?

回答

2

您在字符串“email”后缺少逗号。

t.string "email", :default => "", :null => false 
       ^comma 
+0

是的,就是这样。要为另一个错误创建另一张票。 Thx Dave :) – beach180 2012-01-14 22:40:26

相关问题