Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 3 使用博客引擎创建数据库时出错_Ruby On Rails 3_Refinerycms - Fatal编程技术网

Ruby on rails 3 使用博客引擎创建数据库时出错

Ruby on rails 3 使用博客引擎创建数据库时出错,ruby-on-rails-3,refinerycms,Ruby On Rails 3,Refinerycms,我已经安装了一个应用程序,在我决定安装它的博客引擎之前,一切都很正常 我们从头开始运行应用程序迁移(包括博客),我收到以下错误: Mysql2::Error: Unknown column 'custom_title' in 'field list': INSERT INTO `pages` (`browser_title`, `path`, `meta_description`, `created_at`, `link_url`, `custom_title_type`, `draft`,

我已经安装了一个应用程序,在我决定安装它的博客引擎之前,一切都很正常

我们从头开始运行应用程序迁移(包括博客),我收到以下错误:

Mysql2::Error: Unknown column 'custom_title' in 'field list': INSERT INTO `pages`  (`browser_title`, `path`, `meta_description`, `created_at`, `link_url`, `custom_title_type`, `draft`, `title`, `skip_to_first_child`, `deletable`, `updated_at`, `position`, `rgt`, `custom_title`, `meta_keywords`, `parent_id`, `menu_match`, `lft`, `show_in_menu`, `depth`) VALUES (NULL, NULL, NULL, '2011-03-10 16:32:08', '/blog', 'none', 0, 'Blog', 0, 0, '2011-03-10 16:32:08', 2, 8, NULL, NULL, NULL, '^/blogs?(/|/.+?|)$', 7, 1, NULL)
我已经看到这是一个很好的解决方案,但我无法为开发和生产环境找到一个简洁的解决方案

顺便说一句,我使用
railsgengine\u name
命令安装了一个定制引擎,我看到了这种情况。奇怪的是,如果在之前所有迁移都运行过之后再运行这些迁移,就不会发生这种情况。这只发生在从头开始运行所有应用程序迁移时

有什么想法吗

更新:

这是我在这里收到评论后的
db/seeds/refinerycms_blog.rb
文件:

Page.reset_column_information

User.find(:all).each do |user|
  user.plugins.create(:name => "refinerycms_blog",
                      :position => (user.plugins.maximum(:position) || -1) +1)
end

page = Page.create(
  :title => "Blog",
  :link_url => "/blog",
  :deletable => false,
  :position => ((Page.maximum(:position, :conditions => {:parent_id => nil}) || -1)+1),
  :menu_match => "^/blogs?(\/|\/.+?|)$"
)

Page.default_parts.each do |default_page_part|
  page.parts.create(:title => default_page_part, :body => nil)
end

但它仍然不起作用。有什么想法吗?

将以下内容添加到它复制到db/seeds/中的blog seeds文件的顶部:

Page.reset_column_information

这并不能解决问题。我将编辑此帖子,以便使用此代码进行更新。