Last Updated: February 25, 2016
·
940
· periclestheo

Error compiling SCSS asset- Emacs users

If you are using Emacs, when creating a sassy stylesheet(.scss), the buffer will default to the scss-mode. So far so good.

In a recent Rails project, I used the bootstrap-sass gem and simply added @import 'bootstrap'; to my base.css.scss file.

To my surprise, the *compilation* buffer popped and informed me that file to import not found or unreadable bootstrap-sass!

[31m      error /../app/assets/stylesheets/custom.css.scss (Line 1: File to import not found or unreadable: bootstrap.
Load paths:
  /../app/assets/stylesheets
  /../app/assets/stylesheets)
[0m[33m  overwrite /../app/assets/stylesheets//base.css.css
Compilation exited abnormally with code 1 at Sun Jan 12 17:13:58

After several unsuccessful google searches I found the answer: it's the scss-mode that is causing the compile error!

Not sure though why yet but changing your major mode to the css-mode for example fixed the issue.