Heroku uninitialized constant Refinery::Pages::ContentPagePresenter
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
We need to know what you are overriding. Can you show some code? Thanks.
sorry I forget to add the link of the project https://github.com/3zites/cafeoaxaca
@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
We should support that config.threadsafe!
In the meantime, disable that but we will leave this open and work to fix.
Which version did you upgrade from?
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
@parndt my upgrades were:
- Rails 3.2.6 -> 3.2.9
- Refinerycms 2.0.6 -> 2.0.9
@3zcurdia did Refinery 2.0.6 work with threadsafe!?
@3zcurdia Seems like based on your response Refinery 2.0.6 worked with threadsafe! enabled.. is that the case?
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.
Ah thank you for the workaround @martins
@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 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.