古尔普指南针错误"You need to have Ruby and Compass installed and in your system PATH"



我正在使用gulp-compass将我的scss编译为使用gulp任务css。我运行在Windows 7上。
我的吞咽任务:

gulp.task('styles', function() {
      gulp.src('./sass/design.scss')
    .pipe(compass({
      config_file: './config.rb',
      css: 'stylesheets',
      sass: 'sass',
      require: ['susy', 'breakpoint']
    }))
    .pipe(gulp.dest('dest/css'));
});

我收到以下错误消息:

Error: You need to have Ruby and Compass installed and in your system PATH for this task to work.

我已经安装了Ruby和Compass,并且在我的系统PATH中,所以我看不到问题所在。
我尝试重新安装Ruby和Compass,但也没有帮助。

当我尝试在Mac系统上使用相同的任务时,它工作正常。

gulp-compass 插件替换为 gulp-ruby-sass 不是一种选择,因为他们有一个错误,该错误阻止我使用我需要使用的某些 sass 功能。

我没有Windows 7环境。我认为您必须将以下路径添加到您的系统路径中。

C:Ruby193bin
  • http://www.tutorialspoint.com/ruby/ruby_installation_windows.htm
  • http://rubyonwindowsguides.github.io/book/ch01-01.html

我遇到了这个问题,并通过从系统路径中删除双引号来解决它。我有一个条目:

c:"Program Files"Perforce;

我把它改成:

c:Program FilesPerforce;

该脚本显然无法处理双引号。

您也可以通过将 ruby 文件夹显式添加到"外部 Web 工具"位置来解决此问题,但修复路径是更好的解决方案。

相关内容