Xero1
Xero1

Reputation: 329

Running "sass:dist" (sass) task Errno::ENOENT: No such file or directory @ rb_sysopen - undefined

I'm trying to create a gruntfile which will compile all my scripts, css, and html files (as most grunt files do), and I put in a few commands for sass to compile and put into a separate folder. I hit 'Grunt' and it outputs the error:

Running "sass:dist" (sass) task
Errno::ENOENT: No such file or directory @ rb_sysopen - undefined

the parts that call on my sass in the gruntfile.js are as follows:

Configure Task

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

Register Tasks

});
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' ]
);

Load the Tasks

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

Upvotes: 3

Views: 3546

Answers (2)

Alvis
Alvis

Reputation: 3773

I had the same error. The root cause was that the sass > dist > files configuration was incorrect.

Downgrading to 0.4.x showed the real error. Once I fix the configuration, I have upgraded back to the latest grunt-contrib-sass version and it worked ok.

Upvotes: 3

Xero1
Xero1

Reputation: 329

I downgraded grunt-contrib-sass to 0.4.x and it worked out. Thank you for the help.

Upvotes: 2

Related Questions