问题
I am using Basset which in turn uses assetic for code minification and concatenation.
I have the latest sass installed, using sass -v
tells me it is 3.2.12
I have a css>sass folder and inside that a partials folder. The main.scss imports 2 files from the partials folder. One for variables (colours, widths etc) and the other for layout.
The partials begine with an underscore, so they should not be compiled (_variables.scss) . The main.scss looks like this:
@import "partials/variables";
@import "partials/layout";
partials/_variables.scss:
$bg: blue;
partials/_layout.scss:
body{
background-color: $bg;
}
When it tries to compile, assetic freaks out:
[Assetic\Exception\FilterException]
An error occurred while running:
'/usr/bin/ruby' '/usr/bin/sass' '--load-path' '/Users/Beans/Sites/testsite/public/assets/css/sass' '--scss' '--cache-location' '/private/var/folders/f4/xjby77695pbcgfdjfclfdqd40000gn/T' '/private/var/folders/f4/xjby77695pbcgfdjfclfdqd40000gn/T/assetic_sas
swcqUmJ'
Error Output:
Syntax error: Undefined variable: "$bg".
on line 2 of /Users/Beans/Sites/testsite/public/assets/css/sass/partials/_layout.scss
from line 2 of /private/var/folders/f4/xjby77695pbcgfdjfclfdqd40000gn/T/assetic_sasswcqUmJ
Use --trace for backtrace.
Input:
@import "partials/variables";
@import "partials/layout";
I dont want to use less, i dont want to use laravel-guard (no collection support). I just want this to work!
回答1:
I am not at a location where I can test this but I believe if you publish the configs you have the ability to specify the path to your sass binary.
Edit: The following github issue might help
https://github.com/jasonlewis/basset/issues/154
来源:https://stackoverflow.com/questions/19325012/basset-assetic-sass-wont-compile-imports-osx