grunt.js reports that I have invalid utf-8 - utf-8

I use Grunt for compiling SASS files.
It gives an error message:
Running " Sass : dist " ( Sass ) task
Warning: Error : Invalid UTF-8
Use --force to Continue .
What should I do to fix this?

Presumably, grunt.js requires your input files to be encoded in UTF-8. Check that they are. I don’t know how you’re creating your SASS files, as you haven’t seen fit to tell us. If they’re created by hand in a text editor, check that the text editor is set to save files in UTF-8 encoding.
I don’t really understand why you’ve asked a question here. The error message says that your input files are not in valid UTF-8 encoding. So fix that. What’s the question?

try running with the --verbose tag to get more info.
try running sass outside of grunt - grunt merely interfaces with the sass app.
its possible that there's an error with your grunt config or the files you're attempting to process

Related

sphinx-build force fail on "download file not readable"

Background
I have some docs which include some download files. See example:
Make sure to download :download:`this file</foo/bar_v1.2.tar>` for more details
The site/downloads/foo/bar.tar file is created and moved into the directory as part of the build process.
I am using the sphinx-build -M html . site -W to build the docs.
My issue
When we change the version of the file, the file name changes. Sometimes folks can forget to update this place in the docs and rename the download file correctly.
When I run the sphinx-build command, I see the following error:
download file not readable: /path/to/site/downloads/foo/bar_v1.2.tar
... but the build process continues and sphinx-build exits 0.
My question
I would like sphinx-build to error out when it encounters an unreadable file, but I cannot figure out how to do this.
As noted above, I have tried the -W which is supposed to turn warnings into errors, but it does not work.
Other possibilities
My question stated that I think my problem will be solved by causing sphinx-build to fail for download file not readable messages, but if anyone else has solved similar issues in another way, I would love to hear about it
Thanks.

Browserify working in some folders in windows, but not others

I'm trying to setup a build flow in a Visual Studio environment (13, on Windows 7) using browserify, and I am getting some strange behaviour trying to get browserify to work. I'm new to the environment as well as the technology, so I'm fairly confused here.
For the purposes of this test, my file structure is the same as the Basic API example found here: http://viget.com/extend/gulp-browserify-starter-faq I installed browserify using npm. It is running version 5.12.0
If I place app.js and hideElement.js in a simple directory, such as C:\Temp, and run
c:\Temp> browserify app.js
everything works fine. It bundles up all three of the required files, and spits them out. But if I run the browserify command from my project directory (C:\Users\\documents\visual studio 2013\Projects\ExcelConverter\ExcelConverterWeb), the following error spits out at me:
C:\Users\<name.redacted>\Documents\Visual Studio 2013\Projects\ExcelConverter\ExcelConverterWeb>browserify app.js
Error: SyntaxError: Unexpected token ? while parsing json file package.json
at fns(C:\Users\<name.redacted>\AppData\Roaming\npm\node_modules\browserify\node_modules\module-deps\index.js:402:30)
at fs.js:271:14
at Object.oncomplete (fs.js:107:15)
I've looked at the file in question, and I can't make heads or tails of it. So, what's going on here? How come browserify runs fine when I execute it from one directory, but not from the other? I appear to be using the same executable.
(I'm trying to use browserify as part of a gulp-based build process, but seeing as the errors produced by gulp are basically the same as those I see when I run from the command line)
I have run into "Unexpected token ?" problem. Changing package.json encoding type to 'ANSI' helped solving it. Most of the text editors have that option when "Save As" change Encoding option, then hit "Save"
See if that work for you.

Netbeans - installing SASS

I have had a few attempts at installing SASS on netbeans. I have followed the following tutorial:
http://kgagliardo.com/blog/netbeans-sass-windows-7
I get the below error when creating and trying to save the SASS file and no CSS file is created.
""C:\Ruby193\bin\sass.bat" "--cache-location"
"C:\Users\Leanne\AppData\Local\NetBeans\Cache\7.4\sass-compiler"
"C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\scss\store.scss"
"C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\css\store.css"
'"ruby.exe"' is not recognized as an internal or external command,
operable program or batch file. Done."
I've been stuck on this all morning, please help...
UPDATE
I've tried to follow the instructions provided below and it still does not work, although I did get a slightly different error message:
"C:\Ruby193\bin\sass.bat" "--cache-location"
"C:\Users\Leanne\AppData\Local\NetBeans\Cache\7.4\sass-compiler"
"C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\scss\store.scss"
"C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\css\store.css"
Syntax error: File to import not found or unreadable:
foundation/components/accordion.
Load path: C:/Users/Leanne/Documents/work/freelance/sites/fws_templates
(DEPRECATED)
on line 10 of C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\scss\foundation\foundation.scss
from line 11 of C:\Users\Leanne\Documents\work\freelance\sites\fws_templates\gamer\scss\store.scss
Use --trace for backtrace. Done.
However Now I simply get the original error message again. No idea what to do. See image below showing that I have done everything according to the instructions (I think).
http://i.stack.imgur.com/Eekyt.png
Your path environment variable points to the wrong folder
Your Path to ruby is C:\Ruby193\bin
Go back and edit your path environment variable to point to C:\Ruby193\bin . At the moment you have C:\Ruby\192\bin
EDIT
And Now remove the backslash between Ruby and 193.
Your Path is set to : C:\Ruby\193\bin :-) !
your .bat is in Folder : C:\Ruby193\bin
TIP
Go to Options
Miscellaneous --> CSS Preprocessors
check : Generate extra information (debug)
You don't have path to ruby.exe which is c:\Ruby\192\bin in you PATH variable.
In Windows 7:
Right click on My computer and select Properties -> Go to
Advanced Tab -> Click on the Environmental Variables button
In the Environmental Variables window highlight PATH variable in
System variables section and click Edit
Append ;c:\Ruby\192\bin to the end (the semicolon is intentional)
Restart command prompt
You don't have path to ruby.exe
As simple, reinstall ruby, use ruby installer for windows.
When you go through the installation wizard, you’ll come to this options screen:
From what I can tell, the only option that you need to check on that one is the middle option, which helps your command-line instructions recognize where to find (as it says) “Ruby executables”. Otherwise, you’ll get the error message “ruby is not recognized as an internal or external command” when you try to install Sass in the command prompt.
Go to Options
Miscellaneous --> CSS Preprocessors
check : Generate extra information (debug)
For more information go to Setting Up Sass on Windows
They are all right in the above message. The problem is that Netbeans is not designed to pick up these changes instantaneously. Once you make the changes above, you have to RESTART Netbeans, so that the changes will be applied. This worked for me. Let me know if it works for you.
Thanks

SASS on Sublime Text 3 - [Decode error - output not utf-8]

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.
"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.
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!
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.

"The system cannot find the path specified" when compiling SASS

I'm trying to learn SASS and so I have installed ruby through RubyInstaller and installed the sass gem.
I am able to type out my sass and have the compiler watch the file and write to another just fine, but every time I save my file I get
The system cannot find the path specified
C:\Program Files (x86)\Notepad++)
However everything works as intended, the styles are updated and compiled just fine, but it's quite annoying hitting ctrl+s and having that error keep popping up when it doesn't seem to be affecting anything.
How do I go about troubleshooting this?
Here is a solution for anyone else having the same trouble on notepad++:
Sass-Auto-Compile
For using the Sass-Auto-Compile plugin, you first need to install
another plugin called jN. jN is a plugin for Notepad++, which executes
your JavaScript-scripts in the Notepad++ environment, meaning you can
write plugins in JavaScript
this is the link :
http://www.ninjagame.de/blogContent/Sass-Auto-Compile.js
To get the auto-compiling working, you need to do two things:
Copy this script into the directory “Notepad++/plugins/jN/includes/” .
Now edit the script and change the variable pathToRubyBinDir to the
right value. Mine is: “C:/Program Files/Ruby193/bin/” .
OPTIONAL: There are two more configuration variables:
debugMode: can be true or false. In case of true, you will see the
command line, which calls the compiling process. You can see compiling
errors in this command line window.
outputStyle: this determines, how your .css is going to look like.
(compressed, extended…). See the comments above this variable for more
information.
This guide is copied and pasted from http://deekaysblog.wordpress.com

Resources