Individual stylesheets must be in the sass directory
Asked Answered
C

2

6

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.

Considerate answered 28/9, 2014 at 11:35 Comment(2)
Same here... did you solve it already?Kayceekaye
I'm using the older SASS and Compass version, i haven't tested since thenConsiderate
I
5

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.

Intervalometer answered 28/7, 2015 at 9:19 Comment(0)
L
0

After trying Indivision Dev's solution and others that I saw around the web, I solved this problem by clearing cache:

php app/console cache:clear -e prod
Lions answered 26/1, 2016 at 13:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.