Search code examples
symfonysassvagrantasseticpuphpet

Assetic SCSS filter not dumping CSS files


My Symfony2 configuration is not (re)gerating CSS files from SCSS using asset management with Assetic

when I dump my assets in the CLI with "php app/console assets:install" all files are there, but in my development environment nothing happens, a 500 error appears when my browsers tries to find the CSS file. what's wrong?

Of course everything is installed in my vagrant machine (including ruby and sass gem)

# Assetic Configuration
assetic:
    debug:          "%kernel.debug%"
    use_controller: false
    bundles:        
        - MyBundle
        - BraincraftedBootstrapBundle
    assets:
        my:
            inputs:
                - %kernel.root_dir%/../src/MyBundle/Resources/assets/scss/mytest.scss
            output: %kernel.root_dir%/../web/css/all.css
    #java: /usr/bin/java
    filters:
        #cssrewrite: ~
        scss:
            bin: /usr/local/rvm/gems/ruby-1.9.3-p551/bin/sass
            apply_to: "\.scss$"

edit: it might have something to do with this error in logs/dev.log

[2015-03-02 14:22:22] request.CRITICAL: Uncaught PHP Exception Assetic\Exception\FilterException: 
Error Output: Errno::ETXTBSY: Text file busy

edit 2: it probably has something to do with vagrant folder synchronization. I´m having trouble configuring excluded folders with puphpet.


Solution

  • My final solution the problem was moving the cache directory in the vagrant machine into the /tmp directory by modifying app/AppKernel.php

    just adding these lines of code was enough:

    public function getCacheDir()
    {
        return '/tmp/myapp/cache/' . $this->environment;
    }
    

    it simply moves the cache directory outside of the synchronized vagrant directory.