Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

sorry for my bad English, I'm using symfony2.3 on windows8. When i try to use compass filter i get the error output: "You must compile individual stylesheets from the project directory."

Here is my assetic configuration:

assetic:
    debug:          %kernel.debug%
    use_controller: false
    bundles:        [ ]
    ruby: "C:/Ruby200-x64/bin/ruby.exe"
    #java: /usr/bin/java
    filters:
       cssrewrite: ~
       sass:
           bin: "C:/Ruby200-x64/bin/sass"
       compass:
           bin: "C:/Ruby200-x64/bin/compass"

And here is the view:

{% stylesheets 'bundles/walcore/css/*' filter='compass' %}
    <link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}

When i try to use SASS filter everything work perfectly.

someone could help me please ?!

share|improve this question
add comment (requires an account with 50 reputation)

2 Answers

I ran into this problem myself while attempting to migrate our SF2.2 project to SF2.3, below is a comparison of the command line executed by assetic's CompassFilter in 2.2 and 2.3 versions of the Assetic bundle

SF 2.2.2 AsseticBundle 2.1.3

"C:\Ruby200\bin\ruby.exe" "C:\Ruby200\bin\compass" "compile" "C:\Users\Rick\AppData\Local\Temp" "--boring" "--images-dir" "D:/Projects/cw3sf2/app/../web/bundles/cwmain/images/" "--config" "C:\Users\Rick\AppData\Local\Temp\ass8DCC.tmp" "--sass-dir" "" "--css-dir" "" "C:/Users/Rick/AppData/Local/Temp/ass8DCD.tmp.scss"

SF 2.3 AsseticBundle 2.3.0

"C:\Ruby200\bin\ruby.exe" "C:\Ruby200\bin\compass" "compile" "C:\Users\Rick\AppData\Local\Temp" "--boring" "--images-dir" "D:/Projects/cw3sf2/app/../web/bundles/cwmain/images/" "--config" "C:\Users\Rick\AppData\Local\Temp\assD29B.tmp" "--sass-dir" "--css-dir" "C:/Users/Rick/AppData/Local/Temp/assD29C.tmp.scss"

As you'll notice the previous ProcessBuilder injected empty arguments for --sass-dir and --css-dir through the use of "", whereas the newer ProcessBuilder doesn't. Apparently this causes Compass to spew error messages at you.

Fixing this requires an upstream fix in either the ProcessBuilder, or requires AsseticBundle to manually set the --css-dir and --sass-dir to $tempdir on CompassFilter.php line 316

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

into

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

The error occurs because the ProcessBuilder was changed in the Symfony 2.3 branch, it escapes shell arguments in a different way which ignores empty arguments. Thus causing the required "" to be missing in the generated command. I have raised the issue with the creators of the CompassFilter, though it may need an upstream fix.

share|improve this answer
add comment (requires an account with 50 reputation)

i ran into the same problem. To fix it I used "kriswallsmith/assetic": "v1.1.1 instead of "kriswallsmith/assetic": "1.1.*@dev". Then it was ok for me

share|improve this answer
add comment (requires an account with 50 reputation)

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.