【问题标题】:Seed Dump with Comfortable Mexican Sofa带有舒适墨西哥沙发的种子堆
【发布时间】:2014-03-31 17:11:56
【问题描述】:

在以前的应用程序中,当每个人都需要相同的数据库数据时,我们使用seed_dumper 和rake db:seed:dump 填充种子文件,然后使用rake db:seed。

对于这个应用程序,使用 Comfortable Mexican Sofa CMS gem 和 fortress 插件会很好。只有 seed_dumper 只会转储用户 - 仅此而已。

seed_dump(“父”gem)给出以下错误:

rake aborted!
NameError: undefined local variable or method `cms_manageable' for Comfy::Cms::Page(Table doesn't exist):Class
/usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/activerecord-4.0.0/lib/active_record/dynamic_matchers.rb:22:in `method_missing'
/path to my app/app/models/comfy/cms/page.rb:9:in `<class:Page>'

任何想法或替代方法将不胜感激。干杯。

【问题讨论】:

  • 感觉您使用的是来自 master 分支的 cms,而不是发布的版本。可能会导致一些问题。
  • 只需使用通过 gem install 获得的任何东西。我们已经决定暂时将 SQLite 开发数据库包含在 git 跟踪中。
  • 刚刚试一试,恐怕还是没有乐趣。 undefined local variable or method cms_manageable'`。将 SQLite db 文件添加到 git 跟踪有帮助。当时机成熟时:github.com/comfy/comfortable-mexican-sofa/wiki/… 可能是使用的方法。我认为问题在于 cms_tables 并非都与模型相关联。

标签: ruby-on-rails seeding comfortable-mexican-sofa


【解决方案1】:

现在只使用gem 'seed_dump'(不是seed_dumper),运行命令bundle exec rake db:seed:dump 可以导出种子数据。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多