我正在使用带有自定义引擎的 Refinery CMS,但无法运行heroku rake db:seed
. 似乎这导致我的应用程序在生产中中断。
在本地一切正常,但是当我尝试为我的数据库播种时,我得到了这个输出:
https://gist.github.com/f90b545dc85c44addffd
关于可能导致此问题的任何想法。这是我的seeds.rb 文件:
(Refinery.i18n_enabled? ? Refinery::I18n.frontend_locales : [:en]).each do |lang|
I18n.locale = lang
if defined?(Refinery::User)
Refinery::User.all.each do |user|
if user.plugins.where(:name => 'refinerycms-projects').blank?
user.plugins.create(:name => 'refinerycms-projects',
:position => (user.plugins.maximum(:position) || -1) +1)
end
end
end
url = "/projects"
if defined?(Refinery::Page) && Refinery::Page.where(:link_url => url).empty?
page = Refinery::Page.create(
:title => 'Projects',
:link_url => url,
:deletable => false,
:menu_match => "^#{url}(\/|\/.+?|)$"
)
Refinery::Pages.default_parts.each_with_index do |default_page_part, index|
page.parts.create(:title => default_page_part, :body => nil, :position => index)
end
end
end