title: Heroku run rake db:seed is broken
body: <p>I'm using Refinery CMS with a custom engine and I'm not able to run <code>heroku rake db:seed</code>. It seems that this is causing my app to break in production. </p>
  
  <p>Everything works fine locally, but I'm getting this output when I try to seed my database:</p>
  
  <p><a href="https://gist.github.com/f90b545dc85c44addffd" rel="nofollow">https://gist.github.com/f90b545dc85c44addffd</a></p>
  
  <p>Any thoughts on what might be causing this. Here's my seeds.rb file:</p>
  
  <pre><code>(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 =&gt; 'refinerycms-projects').blank?
          user.plugins.create(:name =&gt; 'refinerycms-projects',
                              :position =&gt; (user.plugins.maximum(:position) || -1) +1)
        end
      end
    end
  
    url = "/projects"
    if defined?(Refinery::Page) &amp;&amp; Refinery::Page.where(:link_url =&gt; url).empty?
      page = Refinery::Page.create(
        :title =&gt; 'Projects',
        :link_url =&gt; url,
        :deletable =&gt; false,
        :menu_match =&gt; "^#{url}(\/|\/.+?|)$"
      )
      Refinery::Pages.default_parts.each_with_index do |default_page_part, index|
        page.parts.create(:title =&gt; default_page_part, :body =&gt; nil, :position =&gt; index)
      end
    end
  end
  </code></pre>