0

When precompiling assets locally, I get this error:

rake aborted!
Invalid CSS after "}": expected "}", was ""
  (in   /Users/nicholas/Documents/sites/ico/app/assets/stylesheets/application.css)
(sass):33123

My problem is I have no idea how or where to track this down. I have over 30 individual CSS files, and it could be coming from any one of them.

Is there any way to find this compiled application.css file and actually see the line of code to determine where this error is coming from?

4
  • 4
    Isn't it in /Users/nicholas/Documents/sites/ico/app/assets/stylesheets/application.css?
    – sawa
    Nov 7, 2013 at 16:12
  • CSS has a pretty clear syntax. You could look the file up, which sawa stated in his comment. IMO this makes more sense than checking the compiled CSS. - You could of course use a validator to fix the error: jigsaw.w3.org/css-validator/#validate_by_input
    – Smamatti
    Nov 7, 2013 at 16:25
  • 1
    @sawa - No, its not there. Application.css in a rails app is only a manifest file and doesn't contain any CSS code.
    – nfriend21
    Nov 7, 2013 at 16:33
  • this may help: stackoverflow.com/questions/17954541/…
    – toms
    Nov 7, 2013 at 16:39

1 Answer 1

2

I think the easiest way to track the bug is to switch off the precompiling in development mode, so the files wouldn't be joined into one application.css

try this in config/environments/development.rb :

# Do not compress assets
config.assets.compress = false

# Expands the lines which load the assets
config.assets.debug = true
3
  • just checked my development.rb, and those settings were already in place.
    – nfriend21
    Nov 7, 2013 at 16:30
  • @Bogdan Agafonov - I tried that too, but there's no application.css file in the public/assets. I also tried the cmd-shift-f trick already, but if you look at my specific error, it only shows a single bracket as the error. This is incredibly vague and doesn't help me pinpoint the bug at all.
    – nfriend21
    Nov 7, 2013 at 16:41
  • @jmromer - I promise. There's an application.js file in there, but not an application.css. I found that strange as well. I think this might be because of the precompilation error, but I dont know.
    – nfriend21
    Nov 7, 2013 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.