0

I always pre-compile my assets locally before pushing to production, but this time I got stuck in an error I can't solve.

This is the error:

rake aborted!
Sass::SyntaxError: Invalid CSS after "  background:": expected expression (e.g. 1px, bold), was "}"
(sass):2967

Problem is I have no idea which file is referring to. I do I solve this problem?

Manuel Frigerio
  • 181
  • 3
  • 10

1 Answers1

0

It's always tricky when you have a big compiled file that comes from a bunch of small files.

I'd recommend using a linter to narrow down where the error is coming from

Try: https://github.com/brigade/scss-lint

Then you can simply run the linter and have it tell you where any problems are!

scss-lint app/assets/stylesheets/

This is also a good thing to work into your CI build, so you can catch problems as they come up

DVG
  • 17,392
  • 7
  • 61
  • 88
  • This is a good one! However, after running the gem I get a lot (tens) of mostly useless advices, like using downcase, etc. Can't really find the problem I'm looking for.. Is there a better way to find issues that blocks the file form being compiled? – Manuel Frigerio Nov 03 '15 at 15:05
  • Found the solution! For people who might have the same problem: run CSS Lint and then look for errors that start with "Syntax Error:". Thanks @DVG – Manuel Frigerio Nov 03 '15 at 15:11