“运行”;sass:dist“;(sass)任务Errno::enoint:没有这样的文件或目录@rb_sysopen-未定义

“运行”;sass:dist“;(sass)任务Errno::enoint:没有这样的文件或目录@rb_sysopen-未定义,sass,gruntjs,npm,Sass,Gruntjs,Npm,我正在尝试创建一个gruntfile,它将编译我的所有脚本、css和html文件(就像大多数grunt文件一样),我为sass输入了一些命令,以进行编译并将其放入一个单独的文件夹中。我点击“咕噜”,它会输出错误: Running "sass:dist" (sass) task Errno::ENOENT: No such file or directory @ rb_sysopen - undefined Grunfile.js中调用my sass的部分如下所示: 配置任务 sass: {

我正在尝试创建一个gruntfile,它将编译我的所有脚本、css和html文件(就像大多数grunt文件一样),我为sass输入了一些命令,以进行编译并将其放入一个单独的文件夹中。我点击“咕噜”,它会输出错误:

Running "sass:dist" (sass) task
Errno::ENOENT: No such file or directory @ rb_sysopen - undefined
Grunfile.js中调用my sass的部分如下所示:

配置任务

sass: {
  dist: {
    files: [{
      expand: false,
      cwd: 'styles',
      src: [ '**/*.scss' ],
      dest: 'build',
      ext: '.css'
    }]
  }
},
注册任务

});
grunt.registerTask(
  'scripts',
  'compiles the Javascript files.',
  [ 'coffee', 'uglify', 'clean:scripts' ]
);
grunt.registerTask(
  'stylesheets',
  'compiles the stylesheets.',
  [ 'autoprefixer', 'cssmin', 'sass', 'clean:stylesheets' ]
);
grunt.registerTask(
  'build',
  'Compiles all of the assets and copies the files to the build directory.',
  [ 'clean:build', 'copy', 'stylesheets', 'sass', 'scripts', 'jade' ]
);
grunt.registerTask(
  'default',
  'Watches the project for changes, automatically builds them and runs a server.',
  [ 'build', 'connect', 'watch' ]
);
加载任务

grunt.loadNpmTasks('grunt-contrib-sass');

我将grunt contrib sass降级为0.4.x,结果成功了。谢谢你的帮助。

我也犯了同样的错误。根本原因是sass>dist>文件配置不正确


降到0.4.x显示了真正的错误。一旦我修复了配置,我已经升级回了最新的grunt contrib sass版本,并且工作正常。

这似乎是一个ruby错误。您使用的是哪个Ruby版本?还有sass gem?看看这个Github问题:我目前正在使用Ruby 2.2.3(x64)和Sass 3.4.19(可选)。在我的package.json文件中,我引用了grunt contrib sass:“0.9.x