gem installed, but still get: error file to import not found or unreadable: compass

Refresh

April 2019

Views

318 time

1

I am trying to compile .scss files of a Prestashop template locally using grunt-contrib-sass. It is configured as following:

sass: {
    dist: {
        files: [{
            expand: true,
            cwd: '_theme/themes/swat-theme/sass',
            src: ['*.scss'],
            dest: '../css',
            ext: '.css'
        }]
    }
},

but I get the following error message:

error file to import not found or unreadable: compass
    on line 1 of _theme/themes/swat-theme/sass/addresses.scss 

I found out I had to install compass on my Windows 7 PC, which I did with gem install compass. All went fine. I checked with compass --version and it returns 1.0.3.

But, when I run grunt sass again, I still get the same error message. The beginning of the addresses.scss file is:

@import "compass";
@import "theme_variables";

How can I solve that issue?

1 answers

1

I solved this issue by adding an option:

    sass: {
        dist: {
            options: {
                compass: true
            },
            files: [{
                expand: true,
                cwd: '_theme/themes/swat-theme/sass',
                src: ['*.scss'],
                dest: '../css',
                ext: '.css'
            }]
        }
    },