lagotto / alm-report

ALM Reports
http://almreports.plos.org/
MIT License
8 stars 3 forks source link

Asset precompile errors on CentOS 6.5 #29

Closed mfenner closed 10 years ago

mfenner commented 10 years ago

This breaks asset precompilation.

Warning. Error encountered while saving cache /var/www/alm_report/releases/20140906012107/tmp/cache/sass/00f8b98f9a29c767e875f8279af59d7a405d0128/static_content.scssc: can't dump anonymous class #<Class:0x000000024e5050>
mfenner commented 10 years ago

This is only a warning, so the actual error with asset precompilation is something else.

jure commented 10 years ago

Most likely related to this: https://github.com/sass/sass/issues/1162 We could try locking sass as shown in the issue:

gem "sass", "~> 3.2.0"
jure commented 10 years ago

How does this bug manifest, Martin? I gather it's more than just showing this warning in the log?

mfenner commented 10 years ago

Will do. Maybe it is also the combination with using dalli, as in https://github.com/sass/sass/issues/1093.

mfenner commented 10 years ago

Deploying with capistrano works fine, but the CSS is then missing. Can't run this on the stage server this weekend, so troubleshooting is a bit tricky.

jure commented 10 years ago

It looks like most of the issues boil down to a bug in sprockets (https://github.com/sstephenson/sprockets/issues/507) which was fixed like so: https://github.com/sstephenson/sprockets/commit/655f129fa910f7d46803fdc66d6d5de53a85f210, i.e. by disabling the cache. Looks like later commits re-added the cache, so people reported warnings/errors with 2.12.1 as well (latest is 2.12.2).

It works OK here though: http://almreports.crowdometer.org/ so the "only" difference is CentOS?

jure commented 10 years ago

I think it's likely that the CSS missing issue is somewhere else, although it does sound suspicious.

mfenner commented 10 years ago

Yes, I think so too. Should we just ignore the warnings then? Not solving this issue, but I've gotten rid of the deprecation warnings regarding newlines.

mfenner commented 10 years ago

Looks like the problem is with layout switching.

ActionView::Template::Error (application.plos.css isn't precompiled):
    1: = stylesheet_link_tag "application.plos"
  app/views/application/plos/_stylesheet.html.slim:1:in `_app_views_application_plos__stylesheet_html_slim__3577476404244319420_69900494917360'
  app/helpers/application_helper.rb:8:in `switch'
  app/helpers/application_helper.rb:26:in `method_missing'
  app/views/layouts/application.html.slim:9:in `_app_views_layouts_application_html_slim__86390098484233524_26054200'
  app/controllers/application_controller.rb:105:in `save_session_dois' (pid:24900)
mfenner commented 10 years ago

This fixes it:

config.assets.precompile += %w( charts.js print.css html5shiv.js application.plos.css )