1

I try to install Compass in my Symfony 2.3.1 project on Windows XP though not successfuly up to now. I have Ruby, compass, sass the newest versions installed.

This is my assetic configuration in app/config/config.yml

# Assetic Configuration
assetic:
    debug:          %kernel.debug%
    use_controller: false
    #bundles:        [ ]
    #java: /usr/bin/java
    filters:
        cssrewrite: ~
        sass:    ~
        compass: ~

Here is my app/cofnfig/parameters.xml

# Assetic
    assetic.filter.compass.images_dir: %kernel.root_dir%/../web/images
    assetic.filter.compass.http_path:  /images
    assetic.filter.compass.bin: C:/Ruby200/bin/compass

The block code including stylesheets section in app/Resources/views/base.html.twig

{% stylesheets filter="compass"
            "@PortalSlubnyMainBundle/Resources/assets/css/main.sass"
            "@PortalSlubnyMainBundle/Resources/assets/css/header.sass"
            "@PortalSlubnyMainBundle/Resources/assets/css/footer.sass"
        %}
        <link rel="stylesheet" href="{{ asset_url }}" />
        {% endstylesheets %}

Ok so when I try to compile this from command line as a result of this command php app/console assetic:dump I get output below:

Dumping all dev assets. Debug mode is on.

17:46:14 [file+] C:/xampp/htdocs/slub/app/../web/css/12c97a7.css

[Assetic\Exception\FilterException] An error occurred while running: "C:\Ruby200\bin\ruby.EXE" "C:/Ruby200/bin/compass" "compile" "C:\Documents and Settings\piotr\Ustawienia lokalne\Temp" "--images-dir" "C:/xampp/htdocs /slub/app/../web/images" "--config" "C:\Documents and Settings\piotr\Ustawi enia lokalne\Temp\ass1C9.tmp" "--sass-dir" "--css-dir" "C:/Documents and Settings/piotr/Ustawienia lokalne/Temp/ass1CA.tmp.sass"

Error Output: You must compile individual stylesheets from the project directory.

Input: html, body { overflow-x: hidden;

    background-color: yellow;

}

assetic:dump [--watch] [--force] [--period="..."] [write_to]

Ruby is working from cmd and it is set in the PATH environment variable as well as compass. Guys any help would be fully apreciated.

EDIT: Thanks for the answer unfortunetly it doesnt help me either.

  1. When I changed names to bundles/portalslubnymain/css/main.sass CLI return me error sth similar to that this file is unable to find, thogh the paths to files seem to be ok

  2. I followed instructions form the article you posted earlier I also checked this article

Community
  • 1
  • 1

1 Answers1

0

Looking at your code i suggest you followed this article. please notice the UPDATE notice at the end!

At first your assets should live in the Resources/public folder ...

... not in Resources/assets. fix this...

Afterwards please change ...

{% stylesheets filter="compass"
        "@PortalSlubnyMainBundle/Resources/public/css/main.sass"
        "@PortalSlubnyMainBundle/Resources/public/css/header.sass"
        "@PortalSlubnyMainBundle/Resources/public/css/footer.sass"

... to

{% stylesheets filter="compass"
    "bundles/portalslubnymain/css/main.sass"
    "bundles/portalslubnymain/css/header.sass"
    "bundles/portalslubnymain/css/footer.sass"

... because some assetic filters ( i.e. cssrewrite ) are known to NOT work with the @-syntax.

Afterwards symlink your assets into the web dir like this:

app/console assets:install web --symlink

Finally you should be able to run

app/console assetic:dump 
Nicolai Fröhlich
  • 51,330
  • 11
  • 126
  • 130