1

Basically, I am in the same boat as this question:

Rails 4 asset compilation is VERY slow (>1min) in dev mode. How to troubleshoot?

But instead of using Bootstrap, I'm using Susy 2 with SASS 3.3 and Rails 4.1 (but not Compass). I'm using the Sprockets 'require' in my application.js manifest, and it's not causing any problems...the snail's pace only happens when I make a change to any SASS file. At the moment I'm needing to use the @import rule in my stylesheet manifest.

I have tried variations on the 'require'/'@import' combination, and they have helped a little bit, but I do have a lot of SASS files and I'd love to just have an application.css.scss manifest that uses SASS's compilation method instead of including a 'global' file with an @import at the top of each SASS file.

I'm wondering whether it could have something to do with the current Sprockets/sass-rails gem issues; during compilation I get a lot of

Warning. Error encountered while saving cache 6b6acdc6a4d802b749fef26e565bbfe3caa60193/style.css.scssc: can't dump anonymous class #<Class:0x007ff59c2c8870>

I'd try moving back to SASS 3.2 if I could and still use Susy 2.

I'd be OK with not using the Asset Pipeline if I could be sure that the app would still play nice with Heroku when pushing to staging/production. I am familiar with both Grunt and Gulp, less so with what using Grunt/Gulp instead of the AP would do to my Rails app.

On the one hand, I'm glad that I'm not alone with this problem, but on the other...I'd love to find a way out of it, if anyone has some suggestions to share! Thanks in advance, SO community!

Community
  • 1
  • 1
Macnab
  • 93
  • 1
  • 6
  • Have you checked how long will sass compilation take using different compilators, f.e. libsass: http://benfrain.com/lightning-fast-sass-compiling-with-libsass-node-sass-and-grunt-sass/ ? – Esse Oct 24 '14 at 20:16
  • Thanks, Esse...I haven't, because I need to use the Asset Pipeline for now and I'm not sure that it has a libsass version that works with Sprockets/Rails? I've only taken a quick look, though. Do you know something different? – Macnab Oct 26 '14 at 00:42
  • 1
    An update: So this is pretty much all about http://stackoverflow.com/questions/22431367/warning-error-encountered-while-saving-cache-cant-dump-anonymous-class ...the time it's taking to compile is Sprockets working through all of those errors. There doesn't seem to be a fix, unless I want to downgrade to Susy One (and change all of my code, at this point). I wish there was a way to turn of the cacheing, but no one is having luck with that, either. – Macnab Oct 30 '14 at 16:21

0 Answers0