1

I'm attempting to run the following Gulp task to compile Sass files, using the plugin, gulp-compass on OS X Yosemite 10.5.5.

var path = require("path");
var gulp = require("gulp");
var compass = require("gulp-compass");

gulp.task("compile2013Base", function() {
    var projectPath = path.join(__dirname, '../../ ');

    gulp.src(['../sass/desktop/css/2013/*.scss']).pipe(compass({
        project: projectPath,
        css: 'htdocs/assets/css/2013/',
        sass: 'sass/desktop/css/2013'
    })).on('error', errorHandler).pipe(gulp.dest('../../htdocs/assets/css/2013/'));
});

function errorHandler (error) {
  console.log(error.toString());
  this.emit('end');
 }

However, when I try to run the task like gulp compile2013Base, I get the following error:

> gulp compile2013Base
[13:39:06] Using gulpfile [**redacted**]/scripts/js/gulpfile.js
[13:39:06] Starting 'compile2013Base'...
[13:39:06] Finished 'compile2013Base' after 9.07 ms
events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: spawn /usr/bin/compass ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
    at child_process.js:1144:20
    at process._tickCallback (node.js:355:11)

I already have compass installed at /usr/bin/compass, and running compass in the terminal does not show any errors. I'm not sure what to go on here, how do I get the error details?

Adam Prax
  • 6,413
  • 3
  • 30
  • 31

1 Answers1

11

This is helped me

sudo gem install -n /usr/local/bin compass

see Error: "compass:dist" Fatal error: spawn /usr/bin/compass ENOENT

Community
  • 1
  • 1
Treeskar
  • 566
  • 5
  • 6
  • That fixed it for me. I was getting this error over and over: throw er; // Unhandled 'error' event ^ Error: spawn /usr/local/bin/compass ENOENT at exports._errnoException (util.js:1022:11) – John F Nov 07 '17 at 21:57