我在用mysql迁移数据库时遇到了问题,于是我决定把整个事情搞得一团糟,转而使用postgres。我已经将它和数据库一起正确安装了,但是现在我得到了与我使用mysql时相同的错误。
$ 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有什么想法吗?
发布于 2012-01-15 06:38:31
字符串"email“后缺少逗号。
t.string "email", :default => "", :null => false
^ commahttps://stackoverflow.com/questions/8865915
复制相似问题