The gulp plugin gulp-ruby-sass doesn't work when compiling sass files .
'use strict'; var path = require('path'); var gulp = require('gulp'); var conf = require('./conf'); var browserSync = require('browser-sync'); var $ = require('gulp-load-plugins')(); var wiredep = require('wiredep').stream; var _ = require('lodash'); gulp.task('styles-reload', ['styles'], function() { return buildStyles() .pipe(browserSync.stream()); }); gulp.task('styles', function() { return buildStyles(); }); var buildStyles = function() { var sassOptions = { style: 'expanded' }; var injectFiles = gulp.src([ path.join(conf.paths.src, '/app/**/*.scss'), path.join('!' + conf.paths.src, '/app/index.scss') ], { read: false }); var injectOptions = { transform: function(filePath) { filePath = filePath.replace(conf.paths.src + '/app/', ''); return '@import "' + filePath + '";'; }, starttag: '// injector', endtag: '// endinjector', addRootSlash: false }; var cssFilter = $.filter('**/*.css', { restore: true }); return gulp.src([ path.join(conf.paths.src, '/app/index.scss') ]) .pipe($.inject(injectFiles, injectOptions)) .pipe(wiredep(_.extend({}, conf.wiredep))) .pipe($.rubySass(sassOptions)).on('error', conf.errorHandler('RubySass')) .pipe(cssFilter) .pipe($.sourcemaps.init({ loadMaps: true })) .pipe($.autoprefixer()).on('error', conf.errorHandler('Autoprefixer')) .pipe($.sourcemaps.write()) .pipe(cssFilter.restore) .pipe(gulp.dest(path.join(conf.paths.tmp, '/serve/app/'))); };
TypeError: glob pattern string required at new Minimatch (/home/john/sac_srvs/new_srvs/sachin/node_modules/gulp-ruby-sass/node_modules/glob/node_modules/minimatch/minimatch.js:108:11) at setopts (/home/john/sac_srvs/new_srvs/sachin/node_modules/gulp-ruby-sass/node_modules/glob/common.js:112:20) at new GlobSync (/home/john/sac_srvs/new_srvs/sachin/node_modules/gulp-ruby-sass/node_modules/glob/sync.js:38:3) at Function.globSync [as sync] (/home/john/sac_srvs/new_srvs/sachin/node_modules/gulp-ruby-sass/node_modules/glob/sync.js:24:10) at /home/john/sac_srvs/new_srvs/sachin/node_modules/gulp-ruby-sass/index.js:68:21 at Array.forEach (native) at Object.gulpRubySass (/home/john/sac_srvs/new_srvs/sachin/node_modules/gulp-ruby-sass/index.js:67:10) at buildStyles (/home/john/sac_srvs/new_srvs/sachin/gulp/styles.js:50:13) at Gulp.sassOptions.style (/home/john/sac_srvs/new_srvs/sachin/gulp/styles.js:20:10) at module.exports (/home/john/sac_srvs/new_srvs/sachin/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7) at Gulp.Orchestrator._runTask (/home/john/sac_srvs/new_srvs/sachin/node_modules/gulp/node_modules/orchestrator/index.js:273:3) at Gulp.Orchestrator._runStep (/home/john/sac_srvs/new_srvs/sachin/node_modules/gulp/node_modules/orchestrator/index.js:214:10) at Gulp.Orchestrator.start (/home/john/sac_srvs/new_srvs/sachin/node_modules/gulp/node_modules/orchestrator/index.js:134:8) at /usr/local/lib/node_modules/gulp/bin/gulp.js:129:20 at process._tickCallback (node.js:415:13) at Function.Module.runMain (module.js:499:11)
This is a tricky one. Looks like you're using generator-gulp-angular
and selected ruby-sass
. Unfortunately, the API of gulp-ruby-sass
has changed in September (with their 2.0.0 release) and the generator wasn't updated since. In a nutshell: the new API needs the source files passed into the stream factory method
.pipe($.rubySass([**SOURCE FILES HERE**], sassOptions)).on('error', conf.errorHandler('RubySass'))
which is basically not possible when combining the build chain with other plugins like inject
or wiredep
.
My recommendation is to use node-sass
instead - if you have no absolute need for ruby-sass
of course.