使用gulp-compass时出现"错误:spawn/usr/bin/compass ENOENT"

Ada*_*rax 1 node.js gulp gulp-compass

我正在尝试运行以下Gulp任务来编译Sass文件,使用OS X Yosemite 10.5.5上的插件gulp-compass.

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');
 }
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试运行任务时gulp compile2013Base,我收到以下错误:

> 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)
Run Code Online (Sandbox Code Playgroud)

我已经在/ usr/bin/compass上安装了指南针,并且compass在终端中运行时没有显示任何错误.我不知道该怎么做,如何获取错误详情?

小智 11

这对我有所帮助

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

请参阅错误:"compass:dist"致命错误:spawn/usr/bin/compass ENOENT