Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gulp-ruby-sass not a recognized command in Windows

I'm trying out gulp for the first time on a Windows Server 2012 VM. I'm normally a Mac user, so I'm a bit new to Windows & Powershell for dev tools like this. I installed Node.js & npm (and nothing else). I created the following basic Gulpfile to compile my Sass:

Gulpfile.js

var gulp = require('gulp'),
    sass = require('gulp-ruby-sass');

gulp.task('styles', function() {
    return gulp.src('Content/sass_new/application.scss')
    .pipe(sass({ style: 'expanded', }))
    .pipe(gulp.dest('Content/css'))
});

gulp.task('watch', function() {
    gulp.watch('Content/sass_new/*', ['styles']);
})

gulp.task('default', ['styles']);

In Windows Powershell, I run the gulp command, and it outputs the following:

[10:02:57] Using gulpfile C:\[path to]\gulpfile.js
[10:02:57] Starting 'styles'...
[10:02:57] gulp-ruby-sass: 'sass' is not recognized as an internal or external command,
operable program or batch file.
[10:02:57] Finished 'styles' after 316 ms
[10:02:57] Starting 'default'...
[10:02:57] Finished 'default' after 15 μs

Am I missing something here? Do I need to install Ruby or Sass? I thought to do that, I'd need a Ruby command prompt and PowerShell wouldn't have access to it. Any guidance is appreciated!

like image 207
Marcelo Somers Avatar asked Jul 24 '14 15:07

Marcelo Somers


People also ask

How do I run a gulp in sass?

Setting up a task Still using the command line, you can install Gulp-sass by running npm install gulp-sass --save-dev . After that, require Gulp-sass in your gulpfile. js. Put var sass = require('gulp-sass'); under the line you required gulp.

Does Sass use Ruby?

Ruby Sass was the original implementation of Sass, but it reached its end of life as of 26 March 2019.


1 Answers

Yes that's right, you need to install Ruby and Sass to get gulp-ruby-sass working.

Begin by download the Ruby installer depending on your specs at this address. Once installed you supposed to have it on your system and accessible by PowerShell or the simple command line.

After, just run the command

gem install sass

And you're done.

like image 190
Preview Avatar answered Nov 14 '22 23:11

Preview