sass doesn't compile: Seg Fault error - ruby

i'm getting this error when i try to compile a scss file with:
sass test.scss test.css
the error in particulary is:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/sass-3.5.2/lib/sass/util.rb:637: [BUG] Segmentation fault
I installed Ruby and Sass via gem. Reinstalling and creating an empty test.css didn't solve the problem.
this is the scss file:
$font-stack: Helvetica, sans-serif
$primary-color: #333
body
font: 100% $font-stack
color: $primary-color
Is there something I'm missing?

Make sure your extension is right! If you use the indented syntax, use .sass, otherwise use .scss. Fixing that lets it compile as expected for me.

Related

SASS cannot watch scss, using [--watch]

I made a standard installation of SASS (Dart Sass 1.16.1), following instructions: https://sass-lang.com/install.
My setup:
node -v : v11.6.0
sass --version: 1.16.0
OS: Ubuntu linux 18.04 LTE.
SASS installation:
npm install -g sass
Process flow:
First creation of CSS from SCSS:
sass index.scss index.css
Attemt to start [--watch]: (the both files are located in same folder):
sass --no-source-map --watch index.scss index.css
Also tried with colon [:] between file names, which actually is only required when specifying folders:
sass --no-source-map --watch index.scss:index.css
After activating the watch, I change something [color: red;] to [color: blue], but css is not update when saving scss.
Terminal printout after running [--watch]: None.
My SCSS file:
$color: blue;
.div-1 {
background-color: $color;
}
The CSS result without running [--watch]:
.div-1 {
background-color: red;
}
I Think the problem might be, that you need to use : between the input and the output.
sass --no-source-map --watch index.scss:index.css
Reference is here:
https://sass-lang.com/guide

Dart/sass on OSX 10.13.3 "Cannot open file"

In trying to learn/use sass for 1st time, I used Homebrew to install dart-sass on recently updated High Sierra 10.13.3 . That worked and sass --version shows 1.1.1 I created a simple .scss file:
$color: #d9534f;
body {
color: $color;
}
and while in the same directory, then issued:
sass main.scss main.css --trace
in console and got:
Error reading main: Cannot open file.
dart:io _File.readAsBytesSync
package:sass/src/io/vm.dart 27 readFile
package:sass/src/compile.dart 33 compile
package:sass/sass.dart 63 compile
package:sass/src/executable.dart 110 main
What do I need to change, learn or do to get this working?
Oops. Reinstall. I ran
brew update multiple times, then
brew uninstall sass then
brew install --devel sass/sass/sass
and now
sass main.scss main.css
works.

Why is the following sass code giving me an error?

(.sass)
div
background-color: cyan
Build error: Transform Sass on dart_gol|lib/forms_menu.sass threw
error: Invalid CSS after "...und-color: #333": expected "{", was ""
on line 6 of standard input
I have Sass installed:
sass --version
"Sass 3.4.22 (Selective Steve)"
I just began using the Sass transformer using pub. I got that error; then went back to --watch . (using Sass via terminal) to see if it happened there. The error was the same both times.
I'm using a .sass extension and it is giving me the problem. I'm using the Sass Basics as a guide.
I did not have a problem when using .scss, with the bracket formatting. I'm not sure why .sass has a problem.
The problem appears to be in the dart_sass_transformer. It isn't properly compiling the sass into css.
Turning off the transformer (removing it from the pubspec) and running sass via Terminal is working properly.
The code in question is just fine.
It tells you it was expecting {
What you need is:
div {
background-color: cyan
}

SASS version mismatch between system and grunt-contrib-compass? [duplicate]

This question already has answers here:
Is Sass 3.3 compatible with Compass?
(3 answers)
Closed 7 years ago.
I've encountered the following issue with grunt-contrib-sass/compass:
(https://github.com/nex3/sass/issues/746)
Compiling this:
.badge {
border: 1px solid black;
&-info {
background:blue;
}
}
Errors this:
Sass Error: Invalid CSS after " &": expected "{", was "-info {"
"-info" may only be used at the beginning of a compound selector.
I have the latest SASS version (3.3.7) installed on the system (Ubuntu 12.04.4 LTS), and running scss from the command line on a fresh file with above code DO work.
However creating a fresh project with yo webapp (Yeoman generator-webapp), with Grunt, gives the above error.
Any thoughts?
As #cimmanon kindly commented, this is probably due to version conflict between SASS and Compass.
As Compass uses it's own version of SASS and I was using grunt-contrib-compass (and not SASS), and my version of Compass was < 1 - the effect was that the 3.3 version I had on my system wasn't used.
Watch out for that when using out-of-the-box Yeoman generators.
So when compiling this with 3.3.6 of SASS I get:
.badge {
border: 1px solid black;
}
.badge-info {
background: blue;
}
But with 3.2.19 I get the same error you do:
Invalid CSS after " &": expected "{", was "-info {"
"-info" may only be used at the beginning of a compound selector.
There's a rather involved history to using suffixes this way, see: A Change in Plans for Sass 3.3
So you have a SASS version problem somewhere in your toolchain.

Compass: Mixins may only be defined at the root of a document

I am not a ruby developer and I have been using Compass for a good 6 months. I have discovered this problem shown below.
I have read this question and used the top rated answer:
getting error after ugrading to sass-3.1.8
Version of Sass: Sass 3.1.1 (Brainy Betty) (as per suggestion)
Compass version: Compass 0.12.1 (Alnilam) (latest)
I run this command: compass compile --force when inside project.
error sass/screen.scss (Line 3 of _utilities.scss: Mixins may only be defined at the root of a document.)
This looks like automatically included file. I definitely can't find it anywhere. My main screen.scss file looks like this:
#import "partials/base";
#import "blueprint/reset";
#import "compass/css3";
#import "sprite/*.png";
$sprite-layout:vertical;
$sprite-spacing: 15px;
#include all-sprite-sprites;
....//blah blah blah rest of rules ....
Help!

Resources