refinerycms icon indicating copy to clipboard operation
refinerycms copied to clipboard

Heroku uninitialized constant Refinery::Pages::ContentPagePresenter

Open 3zcurdia opened this issue 13 years ago • 13 comments

Hi everyone,

I have a site with some overrides hosted on heroku and when I update to refiney 2.0.9 I got this error:

Started GET "/" for 201.141.13.236 at 2012-12-14 07:11:38 +0000
ActionView::Template::Error (uninitialized constant   Refinery::Pages::ContentPagePresenter):
  app[web.1]:  1:  <%= render_content_page(@page, {
  app[web.1]:  2:  :hide_sections => local_assigns[:hide_sections],
  app[web.1]:  3: :can_use_fallback => !local_assigns[:show_empty_sections] && !local_assigns[:remove_automatic_sections]
  heroku[router]: at=info method=GET path=/   host=sitename.herokuapp.com fwd=201.141.13.236 dyno=web.1 queue=0 wait=0ms connect=1ms   service=148ms status=500 bytes=643
  app[web.1]:     4:     }) %>
  app[web.1]:   vendor/bundle/ruby/1.9.1/gems/refinerycms-pages-2.0.9/app/helpers/refinery/pages/content_pages_helper.rb:9:in `render_content_page'

It will be Great if you could help me! currently Im out of ideas

3zcurdia avatar Dec 14 '12 07:12 3zcurdia

We need to know what you are overriding. Can you show some code? Thanks.

ugisozols avatar Dec 14 '12 07:12 ugisozols

sorry I forget to add the link of the project https://github.com/3zites/cafeoaxaca

3zcurdia avatar Dec 14 '12 14:12 3zcurdia

@3zcurdia it's happening because of config.threadsafe! being enabled. Is it really necessary?

Since I don't have experience with that config I can't comment on pros/cons.

/cc @parndt

ugisozols avatar Dec 20 '12 07:12 ugisozols

We should support that config.threadsafe!

In the meantime, disable that but we will leave this open and work to fix.

parndt avatar Dec 20 '12 08:12 parndt

Which version did you upgrade from?

parndt avatar Dec 20 '12 08:12 parndt

thanks @ugisozols , I didnt notice that, and it is not necesary I was testing some stuff for rails 4 and I miss that change in one commit

3zcurdia avatar Dec 20 '12 15:12 3zcurdia

@parndt my upgrades were:

  • Rails 3.2.6 -> 3.2.9
  • Refinerycms 2.0.6 -> 2.0.9

3zcurdia avatar Dec 20 '12 15:12 3zcurdia

@3zcurdia did Refinery 2.0.6 work with threadsafe!?

parndt avatar Dec 21 '12 04:12 parndt

@3zcurdia Seems like based on your response Refinery 2.0.6 worked with threadsafe! enabled.. is that the case?

parndt avatar Jan 07 '13 21:01 parndt

Had the same error (uninitialized constant Refinery::Pages::ContentPagePresenter) with config.threadsafe! enabled even on my developing machine. I was using jruby-1.7.3 + rails (v3.2.13) + puma (v1.6.3) + refinerycms (v2.0.10) . Problem is, that for refinerycms-pages (v2.0.10) presenters are under "lib/refinery/pages" directory. I found workaround by moving presenters to "app/presenters/refinery/pages" in my app.

martins avatar Apr 16 '13 10:04 martins

Ah thank you for the workaround @martins

parndt avatar Apr 16 '13 13:04 parndt

@martins seems that this is where they are located in the master branch so this will be fixed in a future gem version.. You didn't have to move core/lib/refinery/base_presenter.rb under app too?

parndt avatar Apr 16 '13 14:04 parndt

@parndt I didn't have to move base_presenter.rb. I think thats because there is line autoload :BasePresenter, 'refinery/base_presenter' in core/lib/refinery/core.rb.

Other workaround for that uninitialized constant error was to add all Refinery::Pages presenters in pages/lib/refinery/pages.rb same way.

martins avatar Apr 17 '13 06:04 martins