Separate style sheets should be in the sass directory

I am trying to configure 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. 

Here 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 simple css in any of these files, I tried to comment everything, but it continues to throw an error.

I do 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 one should take the file and compile it using the compass filter

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 determined the correct paths for the 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 run the following versions:

SASS: 3.4.5

Compass: 1.0.1

When I canceled these versions to the following values:

SASS: 3.2.19

Compass: 0.12.7

Everything works fine, however I would like to use the latest versions.

+6
source share
2 answers

The specific filter requires 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:

 $pb->add('--sass-dir')->add('')->add('--css-dir')->add(''); 

in

 $pb->add('--sass-dir')->add($tempDir)->add('--css-dir')->add($tempDir); 

This fixed it for me.

+5
source

After trying to solve Indivision Dev and others that I saw on the Internet, I solved this problem by clearing the cache:

 php app/console cache:clear -e prod 
0
source

Source: https://habr.com/ru/post/975961/


All Articles