Search code examples
pythondjangoyui-compressordjango-pipeline

Django pipeliner: /usr/bin/env: yuicompressor: No such file or directory


I have the following versions of django and django-pipeline:

Django==1.10.3
django-pipeline==1.6.9

In /usr/bin/ I see "yui-compresssor" listed. Running collectstatic gives the following error.

pipeline.exceptions.CompressorError: /usr/bin/env: yuicompressor: No such file or directory

When I run my site with debug set to false it loads OK, but when debug is false I just get a 500 error page so the problem is when it is trying to compress the assets.

On my production settings file I have...

PIPELINE['CSS_COMPRESSOR'] = 'pipeline.compressors.yui.YUICompressor'
PIPELINE['JS_COMPRESSOR'] = 'pipeline.compressors.yui.YUICompressor'

Am I missing anything?


Solution

  • It should be

    YUI_BINARY = '/usr/bin/yui-compressor'
    

    Because '/usr/bin/env yui-compressor' is not path to binary

    Another way to fix this is to create symlink

    sudo ln -s /usr/bin/yui-compressor /usr/bin/yuicompressor