I am trying to setup symfony2 to compile sass files.
However every time i run php app/console assetic:dump
i get the following error:
Individual stylesheets must be in the sass directory.
This is what my main.scss looks like:
@import "utilities/variables";
@import "base/layout";
@import "base/footer";
@import "base/modules";
@import "base/form";
@import "base/button";
@import "base/plugin-overrides";
@import "utilities/loaders";
There is no plain css in any of those files, i tried commenting everything but it keeps throwing the error.
I am rendering everything using this:
{% block stylesheets %}
{% stylesheets
filter='compass'
'bundles/mybundle/styles/main.scss'
%}
<link rel="stylesheet" type="text/css" href="{{ asset_url }}"/>
{% endstylesheets %}
{% endblock %}
Which should pick up the file and compile using the filter compass
My configuration for assetic looks like this:
assetic:
debug: "%kernel.debug%"
use_controller: false
bundles: [ 'MaximCMSBundle' ]
#java: /usr/bin/java
filters:
cssrewrite: ~
sass: ~
compass: ~
And i have defined the correct paths for compass and sass in the parameters:
ruby.path: 'C:\Ruby200-x64\bin'
assetic.filter.sass.bin: 'C:\Ruby200-x64\bin\sass'
assetic.filter.compass.bin: 'C:\Ruby200-x64\bin\compass'
assetic.filter.compass.images_dir: '%kernel.root_dir%/../web/images'
assetic.filter.compass.http_path: /images
I am running the following versions:
SASS: 3.4.5
Compass: 1.0.1
When i rollback those versions to the following:
SASS: 3.2.19
Compass: 0.12.7
Everything works fine, however i would like to use the latest versions.
The assetic filter needs a one line change to work with the newer version of Compass / Saas
Edit "vendor/kriswallsmith/assetic/src/Assetic/Filter/CompassFilter.php"
Change Line 312 from:
$pb->add('--sass-dir')->add('')->add('--css-dir')->add('');
to:
$pb->add('--sass-dir')->add($tempDir)->add('--css-dir')->add($tempDir);
That fixed it for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With