在 Rails 3 中从 DataMapper 切换到 Active Record 时出现问题
我已经删除了 Rakefile 中的 DataMapper 特定模型和 gem,并删除了所有数据库。我还更新了我的database.yml 文件。现在,当我尝试生成模型时,
rails g model Car year:integer make:string model:string
我得到:
No value provided for required options '--orm'
是否有地方缺少 Active Record 的规范?我一直无法找到任何用于切换应用程序的 ORM 的文档。
I have removed my DataMapper specific models and gems in my Rakefile and removed all databases. I also updated my database.yml file. Now, when I attempt to generate a model with
rails g model Car year:integer make:string model:string
I get:
No value provided for required options '--orm'
Is there someplace that I am missing the specification of Active Record? I've been unable to find any documentation for switching an application's ORM.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看
config/application.rb
中,您可能有一行如下所示的行:将
:datamapper
符号更改为:active_record
或完全删除该行以切换回 ActiveRecord。如果不存在,您可能在 config/initializers 中有一个文件可以为您完成此设置。
Have a look in
config/application.rb
, you may have a line that looks like this:Change that
:datamapper
symbol to:active_record
or remove that line completely to switch back to ActiveRecord.If it's not there, you may have a file in
config/initializers
which does this setup for you.