2013-10-10 31 views
0

我创建了一个grunt文件来保存我的Sass代码和JavaScript。虽然这对JavaScript部分的工作非常好,但在编译Sass时失败了,即使正确给出了目录和文件名,也无法找到要使用的源文件。为什么我的grunt/Sass/Ruby代码中找不到“找不到这样的文件或目录”?

我收到的错误是:

Running 'sass:dist' <sass> task 
Errno:ENOENT No such file or directory - Content/site.scss 

这是我的咕噜声文件:

module.exports = function(grunt) { 

    var jsSource = [ 
    'Scripts/jquery-1.10.2.js', 
    'Scripts/jquery.cookie.js', 
    'Scripts/respond.1.1.0.js', 
    'Scripts/jquery-ui-1.10.3.custom.js', 
    'Scripts/script-compensation.js', 
    'Scripts/webtrends.load.js' 
    ]; 
    var jsDebug = 'scripts/site.js'; 
    var jsRelease = 'scripts/site.min.js'; 
    var jsWatchFiles = ['Scripts/script-compensation.js']; 
    var cssWatchFiles = ['Content/*.scss']; 
    var scssSource = ['Content/site.scss']; 

    // Project configuration. 
    grunt.initConfig({ 

    concat: { 
     application: { 
     src: jsSource, 
     dest: jsDebug 
     } 
    }, 

    uglify: { 
     options: { 
     report: 'min' 
     }, 
     application: { 
     src: ['<%= concat.application.dest %>'], 
     dest: jsRelease 
     } 
    }, 

    sass: { 
     options: { 
      style: 'expanded' 
     }, 
     dist: { 
      files: { 
       'Content/site.css': scssSource 
      } 
     } 
    }, 

    watch: { 
     js: { 
     files: jsWatchFiles, 
     tasks: ['concat'] 
     }, 

     css: { 
      files: cssWatchFiles, 
      tasks: ['sass'] 
     } 
    } 

    }); 


    // These plugins provide necessary tasks. 
    grunt.loadNpmTasks('grunt-contrib-concat'); 
    grunt.loadNpmTasks('grunt-contrib-sass'); 
    grunt.loadNpmTasks('grunt-contrib-uglify'); 
    grunt.loadNpmTasks('grunt-contrib-watch'); 

grunt.registerTask("default", function(){ 
    grunt.log.writeln("grunt workflow task list:"); 
    grunt.log.writeln("\tgrunt watch - Watch js and scss"); 
    grunt.log.writeln("\t\tWindows: use 'start /d . grunt watch' for background process"); 
    grunt.log.writeln("\tgrunt debug - Build the debug files"); 
    grunt.log.writeln("\tgrunt release - Build the release files"); 
    }); 

    grunt.registerTask('debug', ['concat']); 
    grunt.registerTask('release', ['concat', 'uglify']); 
}; 

我认为错误是由红宝石本身来,但我不能肯定。有没有人跑过这个,如果是的话,我能做些什么来解决?任何帮助将不胜感激。

回答

1

尝试使用File.expand_path()或给出完整路径?

相关问题