kaizencoding
kaizencoding

Reputation: 51

Django-pipeline doesn't find file or directory when running collectstatic

I've installed django-pipeline package and it works perfectly on my local computer.

The problem happens when I run collectstatic on production and I get this error:

raise CompressorError(stderr) pipeline.exceptions.CompressorError: b'/usr/bin/env: \xe2\x80\x98yuglify\xe2\x80\x99: No such file or directory\n'

I've also tried to use a different compressor and it does no work either.

Here is my settings:

STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'pipeline.finders.PipelineFinder',
)

STATIC_URL = '/static/'
STATIC_ROOT = '/home/user/app/static'

MEDIA_ROOT = '/home/user/app/src/media'
MEDIA_URL = '/media/'


PIPELINE = {
    'PIPELINE_ENABLED': True,
    'STYLESHEETS': {
        'main': {
            'source_filenames': (
              '/home/user/app/static/css/main.css',
            ),
            'output_filename': 'css/main.css',
        },
    },
    'JAVASCRIPT': {
        'main': {
            'source_filenames': (
              '/home/user/app/static/js/main.js',
            ),
            'output_filename': 'js/main.js',
        }
    }
}

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

What am I doing wrong?

Thank you so much!

Upvotes: 2

Views: 1213

Answers (1)

nitzspiz
nitzspiz

Reputation: 111

It looks like you don't have yuglify installed on your environment.

I assume you're dealing with unix so it's quite easy to confirm: run the command which yuglify to see where it is installed, if no results are received you should install yuglify on the environment.

I personally installed it smoothly through npm: npm -g install yuglify

Upvotes: 2

Related Questions