我正在尝试创建此 Rails 迁移
class CreateFormats < ActiveRecord::Migration
def self.up
create_table (:formats , :options => 'ENGINE=InnoDB DEFAULT CHARSET=utf8' ) do |t|
t.name
t.description
t.company
t.timestamps
end
end
def self.down
drop_table :formats
end
end
我在执行过程中遇到如下错误:
语法错误,意外 ',',期待 ')' create_table (:formats , :options => 'ENGINE=InnoDB D... ^ 语法错误,意外')',期待 keyword_end ...=InnoDB DEFAULT CHARSET=utf8' ) 做 |t| ... ^
语法错误,意外的keyword_end,期待$end
知道为什么会这样吗?我的语法找不到任何问题..很可能是因为我是 Rails 新手 :)