Compass error "Individual stylesheets must be in the pass directory" in Symphony2 in Windows environment

Asked 1 years ago, Updated 1 years ago, 117 views

I usually work in a Linux environment, but
You must create a Symphony 2 environment in your Windows environment.

Install the XAMPP package on Windows and
Configured the Symphony 2 framework.

The system was configured and worked fine, but
There is an error in the Compass configuration and the cause of the problem is unknown.

config.yml:

#Assetic Configuration
associate:
    debug: "%kernel.debug%"
    use_controller: false
    write_to: %kernel.root_dir%/../../html/
    # bundles: [ ]
    # java: /usr/bin/java
    filters:
        cssrewrite: ~
        sass:
            bin: "C:\Ruby\bin\sass"
        compass:
            bin: "C:\Ruby\bin\compass"
        yui_css:
            jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.8.jar"
        yui_js:
            jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.8.jar"
        close:
            jar: "%kernel.root_dir%/Resources/java/compiler.jar"

error message:

[exception] 500 | Internal Server Error | Asset\Exception\FilterException
[message] Error occurred while running:
"C:\Ruby\bin\ruby.EXE" "C:\Ruby\bin\compass" "compile" "C:\Users\user\AppData\Local\Temp" " --boring" " --config" "C:\Users\user\AppData\Local\Temp\ass 1047.tmp" " --ass-dir" / "/ --/ "AppDirusers"

Error Output:
Individual stylesheets must be in the pass directory.

I do not understand the error in the "Individual styles sheets must be in the pass directory." part.
Compass There is no problem to use and operate individually.
I don't understand how to configure it in Symphony2.
In addition to Compass&Sass path settings, Compass is also running in Linux with the same settings.

Environment

Windows:7
Ruby: 2.1.5
Sass: 3.4.10
Compass: 1.0.3

ruby symfony2 sass

2022-09-29 22:20

1 Answers

Edit the following file
kriswallsmith/assetic/src/Assetic/Filter/CompassFilter.php

Near line 312

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

to

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

Changed yuicompressor-2.4.8.jar to yuicompressor-2.4.7.jar.

#Assetic Configuration
associate:
    debug: "%kernel.debug%"
    use_controller: false
    write_to: %kernel.root_dir%/../../html/
    # bundles: [ ]
    java: C:\Program Files (x86)\Java\jre1.8.0_31\bin\java.exe
    ruby: C:\Ruby\bin\ruby.exe
    filters:
        cssrewrite: ~
        sass:
            bin —C:\Ruby\bin\ass
        compass:
            bin: C:\Ruby\bin\compass
        yui_js:
            jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"
        yui_css:
            jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"

It worked just like this.


2022-09-29 22:20

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.