appleboy / gulp-compass

Compass plugin for gulp
MIT License
174 stars 55 forks source link

Individual stylesheets must be in the sass directory. #82

Open spyesx opened 9 years ago

spyesx commented 9 years ago

Hello all,

I just updated Gulp and I have to face a problem I didn't have 'til now.

Individual stylesheets must be in the sass directory. events.js:72 throw er; // Unhandled 'error' event ^ Error: Compass failed

Here is my gulpfile.js


var gulp = require('gulp'),
    compass = require('gulp-compass'),
    livereload = require('gulp-livereload');

gulp.task('compass', function()
{
    return gulp.src('src/assets/sass/**/*')
        .pipe(compass())
        .pipe(gulp.dest('src/assets/css/dev'));
});

gulp.task('watch', function()
{
    var server = livereload();

    gulp.watch('src/assets/sass/**/*', ['compass']).on('change', function(e){
        console.log(e.path);
    });

    gulp.watch(['src/assets/css/**/*.css']).on('change', function(e){
        server.change(e.path);
    });
});

gulp.task('default', ['compass'], function(){

});

The folders didn't change:

|-- gulpfile.js
|-- src
|   |-- assets
|   |   |-- bower
|   |   |-- css
|   |   |   |-- dev
|   |   |   |-- prod
|   |   |   |-- vendor
|   |   |-- js
|   |   |   |-- dev
|   |   |   |-- prod
|   |   |   |-- vendor
|   |   |-- img
|   |   |-- fonts
|   |   |-- sass

Any idea?

Avcajaraville commented 9 years ago

I have this problem all the time, post it on issues (if you have a look, there is a few of them already).

I never have an answer... I just give up... I use compass watch with sourcemaps, that allows me to write and refresh on chrome dev. I also have a task, that refresh the browser each time a css is refreshed by compass watch.

Anyway, I keep following this repo. hoping to find a solution for this... But nothing, no satisfying answers.

I truly believe that actually, a good workflow with gulp compass will never be possible. Compass goes on ruby, then goes to JS (gulp), and for larger projects, compiling time its just too expensive.

Also, I dont expect to have a lib-sass with compass neither (lib-sass is C and compass ruby).

So, all this tools sounds very nice in practice, but obviously, they are not a reality yet. Not for larger projects.

Hope we find something at some point.

Good luck !

camilonova commented 9 years ago

I had the same problem too, you must send parameters like:

var compass_options = {
    config_file: 'path/to/config.rb',
    css: 'css',
    sass: 'sass',
    debug: true,
    sourcemap: true
}

.pipe(compass(compass_options))

You can remove debug: true when works for you.

adyz commented 9 years ago

I have the same issue with current compass installation, but if I install an older one (1.0.0.alpha.16) everything work fine.

Any idea why?

adyz commented 9 years ago

Here is my log:

18:54:07] gulp-compass: Running command: /usr/local/bin/compass compile . /Users/adrian/Desktop/Vivre/Setup-Centos-PuPHPet/vivre/scss/updates.scss --no-line-comments --debug-info --images-dir images --css-dir css --sass-dir scss --require susy --require modular-scale [BS] Proxying: http://vivre.adrian.ro [BS] Now you can access your site through the following addresses: [BS] Local URL: http://localhost:3000 [BS] External URL: http://192.168.100.1:3000 [18:54:07] Individual stylesheets must be in the sass directory.

jaumesalatantinya commented 8 years ago

I solved this way passing the whole rute to de gulpfile.js. It seams that de gulpfile.js is mandatory over config.rg

gulp.task('compass', function() { gulp.src('./app/*.scss') .pipe(compass({ config_file: 'config.rb', css: '/Users/jaume/workspace/sass/app', sass: '/Users/jaume/workspace/sass/app' })) .pipe(gulp.dest('./app/')); });