当我运行 rake db:migrate 时,我得到了
语法错误,意外的 '\n',需要 tCOLON2 或 '[' 或 '.'
错误请帮助我
class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string, :name
t.string, :email
t.string :login
t.timestamps
end
end
end
最佳答案
class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :name
t.string :email
t.string :login
t.timestamps
end
end
end
您在字符串类型之后输入了 , 这是唯一的语法错误。
关于ruby-on-rails - 语法错误,意外 '\n' ,当我运行 rake db :migrate 时,需要 tCOLON2 或 '[' 或 '.',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30593063/