Basset/Assetic + SASS不会编译导入(OSX) [英] Basset/Assetic + SASS wont compile imports (osx)
问题描述
我正在使用Basset,后者又使用资产式代码最小化和串联.
我安装了最新的sass,使用sass -v
告诉我它是3.2.12
我有一个css> sass文件夹,并且在其中有一个parts文件夹. main.scss从partials文件夹导入2个文件.一个用于变量(颜色,宽度等),另一个用于布局.
partials以下划线开头,因此不应进行编译(_variables.scss) . main.scss看起来像这样:
@import "partials/variables";
@import "partials/layout";
partials/_variables.scss:
$bg: blue;
partials/_layout.scss:
body{
background-color: $bg;
}
当它尝试编译时,资产会吓跑:
[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";
我不想使用更少,我不想使用laravel-guard(不支持收集).我只是想让它工作!
我不在可以测试此位置的位置,但是我相信,如果发布配置,则可以指定sass二进制文件的路径. /p>
以下github问题可能有帮助
https://github.com/jasonlewis/basset/issues/154
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!
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
这篇关于Basset/Assetic + SASS不会编译导入(OSX)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!