0

I just recently copied over my local gulpfile and packages to a server in order to compile sass on the server instead of having to copy the file over everytime I make a change. The gulp tasks worked fine before, but now when I try my gulp css task, I get this error.

Starting 'css'...

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: Gem undefined is not installed.

Here is my gulpfile. I thought I had all the errors handled, but I guess I missed something. Gulpfiles are so confusing...

var gulp = require('gulp');
var minifycss = require('gulp-cssnano');
var autoprefixer = require('gulp-autoprefixer');
var notify = require('gulp-notify');
var sass = require('gulp-ruby-sass');
var concat = require('gulp-concat');
var sourcemaps = require('gulp-sourcemaps');

gulp.task('css', function() {
    return sass('scss/**/*.scss')
        .pipe(sourcemaps.init())
        .pipe(autoprefixer())
        .pipe(concat('ivie2017.css'))
        .on('error', sass.logError)
        .pipe(sourcemaps.write())
        .pipe(gulp.dest('./css'))
            .pipe(notify({ message: 'Wait for it....wait for it!!!' }));
});

gulp.task('default', function() {
    gulp.watch('scss/**/*.scss',['css']);
});
tadman
  • 208,517
  • 23
  • 234
  • 262
Kathryn Crawford
  • 611
  • 1
  • 10
  • 27
  • How are you running this? – tadman Oct 18 '16 at 19:22
  • So I installed gulp and the gulp dependencies with npm and then I am running the "gulp css" command from the terminal – Kathryn Crawford Oct 18 '16 at 19:27
  • I hope that's what you were asking.... – Kathryn Crawford Oct 18 '16 at 19:27
  • I'm not sure why you're getting Ruby errors when running Gulp JavaScript code. You've got a lot going on in that CSS method. Have you tried stripping it down to simplify it until it works, then build it back up again piece by piece until it breaks? Divide and conquer. – tadman Oct 18 '16 at 19:28
  • I just tried that and I keep getting the same error no matter what I have in that method. It must be a ruby thing. 2.3.1 is installed on the server. Maybe it is TOO up to date? Also node, npm and gulp are installed globally and gulp is also installed locally. – Kathryn Crawford Oct 18 '16 at 19:37
  • 1
    Oh my goodness. I didn't have ruby sass installed. Just gulp-ruby-sass. Dependencies! UGH! – Kathryn Crawford Oct 18 '16 at 19:49

2 Answers2

0

Ruby gem for Sass was not installed. I ran the command "gem install sass" and afterwards my scss compiled just fine!

Kathryn Crawford
  • 611
  • 1
  • 10
  • 27
  • It's worth explaining not just what the problem was, but how you fixed it. Good to see you got it, though! – tadman Oct 18 '16 at 19:51
0

Run $ npm install --save-dev gulp-ruby-sass to install gulp ruby sass.

https://github.com/sindresorhus/gulp-ruby-sass#install

Sebastian
  • 1,109
  • 4
  • 17
  • 33