0
votes

I've downloaded Ruby and installed Sass. I then installed Sass Build for Sublime Text 2 through the package manager but when I try to build my css file, nothing happens.

It says :

[Decode error - output not utf-8] [Finished in 0.1s with exit code 1]

Does anyone know how to fix this ?

1
Why are you trying to build a .css file? - MattDMo
How would it work then ? - user3292788
sass is a compiler that turns nice, pretty, fun-to-write SASS/SCSS into functional (but more difficult to write) CSS. So, you need some SASS or SCSS input to feed to the compiler, which (when set up properly) spits out CSS for your site. Visit the SASS website to learn how to download, install, and set up everything. The Package Control page for SASS Build is also helpful. - MattDMo
I appreciate the fact that you are trying to help me but we are totally off topic. I'm not a beginner and I know what is SASS and CSS :) I actually compile my SASS files with Koala after I had used Scout but I wanted to use the build system of ST to work faster. So my question was why when I try to build my CSS file, no file is beeing created. You can see a similar issue in this topic - user3292788

1 Answers

1
votes

By default, the output encoding in a sublime build is utf-8. This will cause an error if there are non-utf-8 characters in your sass or scss.

You can create a custom sass .sublime-build along the lines of the following by going to Tools > Build System > New Build System.

{

    "cmd": ["sass", "--update", "$file:${file_path}/${file_base_name}.css", "--stop-on-error", "--no-cache"],
    "selector": "source.sass, source.scss",
    "line_regex": "Line ([0-9]+):",

    "osx":
    {
        "path": "/usr/local/bin:$PATH"
    },

    "windows":
    {
        "shell": "true"
    }

    "encoding": "cp1252"
}

Note the key (the only one that'll be surplus from the installed package) "encoding": "cp1252". Its value will have to match that of your source or be a superset thereof. There's a fairly comprehensive list of codecs in the Python docs.