Questions tagged [gulp-ruby-sass]

a gulp plugin for compilation of Sass to CSS using Ruby Sass gem.

gulp-ruby-sass is a gulp plugin to compile Sass files (.scss) to CSS files using Ruby Sass gem.

Basic usage example:

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

gulp.task('sass', function() {
    return sass('source/') 
    .on('error', function (err) {
      console.error('Error!', err.message);
   })
    .pipe(gulp.dest('result'));
});

Sophisticated usage example (used with gulp-sourcemaps and gulp-livereload):

var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var livereload = require('gulp-livereload');
var sass = require('gulp-ruby-sass');

// Compile public Sass task
gulp.task('sass_site', function () {
  return sass('public/_sources/sass/main.scss', { style: 'compressed' })
    .pipe(sourcemaps.init())
    .pipe(sourcemaps.write('./maps'))
    .pipe(gulp.dest('public/_assets/css'))
    .pipe(livereload());
});

// The watch task
gulp.task('watch', function () {
  livereload.listen();

  // Use this for logging in terminal
  gulp.watch('public/_sources/sass/**/*.scss', ['sass_site']).on('change', function (file) {
    livereload.changed(file.path);
    gutil.log(gutil.colors.yellow('Public CSS changed' + ' (' + file.path + ')'));
  });

  // Or this if you don't need logging
  // gulp.watch('public/_sources/sass/**/*.scss', ['sass_site']);
});

To run the example issue gulp sass_site or gulp watch command in terminal.

49 questions
11
votes
3 answers

gulp-ruby-sass - 'sass' is not recognized as an internal or external command, operable program or batch file

I'm trying to run gulp-ruby-sass on Windows. I've already installed Ruby and Sass like that: $ gem install sass My gulp.task looks like this: gulp.task('styles', function() { return sass('src/scss/**/*.scss') .on('error', sass.logError) …
Strauss808
  • 221
  • 1
  • 2
  • 6
9
votes
1 answer

TypeError: glob pattern string required

I'm trying to compile sass using gulp-ruby-sass but I'm getting TypeError: glob pattern string required. This is what my gulpfile.js looks like: var gulp = require('gulp'), sass = require('gulp-ruby-sass'); var paths = { sassSrcPath:…
msmolcic
  • 6,407
  • 8
  • 32
  • 56
7
votes
2 answers

How to compile SASS files in different directories using Gulp?

I'm using gulp-ruby-sass to compile my js and sass. I ran into this error first TypeError: Arguments to path.join must be strings Found this answer and it was because I was using sourcemaps with gulp-sass and the answer recommended using…
Leon Gaban
  • 36,509
  • 115
  • 332
  • 529
6
votes
3 answers

gulp plugin gulp-ruby-sass not compiling

Gulp plugin gulp-ruby-sass(https://github.com/sindresorhus/gulp-ruby-sass) giving not compiling, the error message in terminal coming like this Error: must provide pattern Here is the gulpfile.js details var gulp = require('gulp'), uglify =…
Mo.
  • 26,306
  • 36
  • 159
  • 225
3
votes
0 answers

gulp-ruby-sass not working

I did everything exactly as stated in docs: https://github.com/sindresorhus/gulp-ruby-sass/blob/master/readme.md This is my code in gulpfile.js: // Sass configuration const gulp = require('gulp'); const sass = require('gulp-ruby-sass'); const…
yodalr
  • 9,778
  • 10
  • 32
  • 47
3
votes
1 answer

Gulp-ruby-sass Error :

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…
Sachin Bapure
  • 53
  • 1
  • 5
3
votes
1 answer

New gulp-ruby-sass alpha task failing

I've used the gulp-ruby-sass a number of times, however on this new project my task is failing with the following error: gulp-ruby-sass stderr: OptionParser::NeedlessArgument: needless argument: --sourcemap=none Use --trace for backtrace. Here's…
user3731438
  • 283
  • 8
  • 19
2
votes
0 answers

gulp-ruby-sass compiled to wrong directory

I forked github repo from here https://github.com/expressly/angular-browserify-seed, installed everything, but gulp doesn't work correctly. The problem is that, if I change something in app.scss (src style file), gulp compile it not to build folder,…
WhatIsHTML
  • 548
  • 1
  • 7
  • 19
2
votes
1 answer

Why did my gulp task stopped generating my css files?

I use sass (triggered by a gulp task) to generate my css files. I recently formatted my computed and this task stopped working.  var sass = require('gulp-ruby-sass'); var config = require('../config'); gulp.task('styles', ['copy'], function() { …
Marco Blos
  • 933
  • 9
  • 22
2
votes
1 answer

How to set SASS settings to noCache = True? Using Gulp & gulp-ruby-sass

I'm not using compass or codekit, just Gulp to compile my SASS files. And a .sass-cache folder gets generated. I'd rather it not and don't mind the extra nano secs it would take to compile, because it adds too much to my quick find in Sublime…
Leon Gaban
  • 36,509
  • 115
  • 332
  • 529
2
votes
1 answer

Gulp inline sourcemaps not working

I'm trying to get the sourcemaps to work with Gulp. I'm using gulp-ruby-sass and gulp-sourcemaps. The inline sourcemap gets inserted in the CSS file but it still doesn't work in Chrome even though I've enabled sourcemaps. I can still only see the…
Brigante
  • 1,921
  • 6
  • 23
  • 33
1
vote
0 answers

Cannot install Ruby Sass on macOS

I had dart sass in my macOS Sierra(version 10.12.6). I uninstalled it to install ruby sass, the installation seems to be successful but when I check the version of sass I am getting an error message $ gem install sass -v3.5.2 Successfully installed…
dany
  • 1,801
  • 7
  • 27
  • 40
1
vote
1 answer

how to preserve quoted chars in sass

How can i preserve or escape paths in sass. We have strings like "Page\Footer\CustomBar\Logo" which are (wrongly) transformed internally to "Page\footer\customBarLogo" How can we preserve the ascii format? We tried with dart sass and ruby…
Robert
  • 176
  • 1
  • 19
1
vote
1 answer

Sass is not found for gulp-ruby-sass within Docker container

I have a web application that uses the gulp-ruby-sass plugin and it runs within a container that installs the sass gem. This is the Dockerfile: FROM phusion/passenger-customizable:0.9.19 # Set correct environment variables. ENV HOME /root # Use…
Paolo Carrasco
  • 59
  • 1
  • 1
  • 10
1
vote
1 answer

Using Gulp with Visual Studio Team Services

I'm looking to set up automated builds with Visual Studio Team Services but I keep running into trouble. My build definition: npm install gulp npm install --save-dev jshint gulp-jshint ruby npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano…
Mike
  • 517
  • 2
  • 5
  • 21
1
2 3 4