SASS on Sublime Text 3 - [Decode error - output not utf-8]
-
02-01-2020 - |
Pergunta
I've been trying to use sass in sublime text 3 today and for that I installed Ruby, Ruby SASS gem and the Sublime packages Sass and Sass Build. All seems to be working well but when I try to build the css file (using the Sass Build package) I get this weird error:
[Decode error - output not utf-8]
[Finished in 0.1s with exit code 1]
[cmd: ['sass', '--update', 'F:\\Program Files (x86)\\wamp\\www\\singlepage\\wp-content\\themes\\manaca\\style.scss:F:\\Program Files (x86)\\wamp\\www\\singlepage\\wp-content\\themes\\manaca/style.css', '--stop-on-error', '--no-cache', '--style', 'compressed']]
[dir: F:\Program Files (x86)\wamp\www\singlepage\wp-content\themes\manaca]
[path: C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;F:\Program Files (x86)\MacType;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files (x86)\Autodesk\Backburner\]
And when I try to build the compressed CSS (from the same package) it simply returns
[Decode error - output not utf-8]
[Finished in 0.1s]
What's been bugging me is the crazy file paths returned in the last line (shouldn't even be searching in C: )
The other thing I've been researching about is the output not utf-8
thing. Even if I specify the charset on my sass (or scss) file, the problem lingers.
Anyway, I appreciate any type of help I can get.
Solução 2
I've worked around the problem.
The path thing was a missing step of my Ruby installation on Windows. I needed to register Ruby's path in Environment Variables.
But still the package Sass Build wasn't working so I opened cmd and told Sass to watch the file, inside my website folder:
cd "program files (x86)\..\mysite"
sass --watch style.scss:style.css --style compact --no-cache
Now every time I save the style.scss file the css file is updated properly.
Hope that clarifies the process to anyone else!
Outras dicas
"shell": true
- this is the key.
If I try build-system like this (on WinXP):
{
"cmd": ["ant", "-f", "project-build.xml"],
"working_dir": "${project_path}"
}
I get:
[Decode error - output not utf-8]
because cmd
should be "ant.bat"
instead.
Sublime is looking for file exacly called ant
and encoding of "file does not exist"
message is not utf-8.
When I use shell like this:
{
"cmd": ["ant", "-f", "project-build.xml"],
"working_dir": "${project_path}",
"shell": true
}
everything works fine (even without "windows": { "cmd": ....}
) because shell searches for ant.exe
and then ant.bat
.
Just a reference for people who had similar problem and the accepted answer didn't help:
I had a similar error, in my case I had to install python and add it to the PATH environment variable.
add ruby to envirement variable PATH.
I've got this error when I open Sublime Text from a console window. Open Sublime from a normal shortcut.
Just in case someone else comes across this on a different matter, I was building a project in openCL (using C API not C++) and encountered this error.
Turns out I hadn't allocated enough memory for the string to hold the program build log.