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
0
votes
1 answer

Compiling Foundation 6 with Gulp and gulp-ruby-sass

I'm learning Django, Foundation, Gulp, and SASS all at once. It's been tons of fun so far, but I've hit a brick wall now. I'm trying to compile Foundation 6 with Gulp. Foundation's documentation gives an example of how to do this with Grunt, but…
MadEmperorYuri
  • 298
  • 3
  • 11
0
votes
1 answer

Glob Pattern String Error- gulp-ruby-sass

I have looked at some answers here, but I am completely new to this so I wasn't able to understand. Could someone take a look at my code and tell me what could have gone wrong. Also if you could explain what this error means. Attached is a…
user6335373
0
votes
2 answers

Gulp compiling error js.72. Unhandled error

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,…
Kathryn Crawford
  • 611
  • 1
  • 10
  • 27
0
votes
0 answers

No Output on Running Gulp SASS

Gulp Version 3.9.1 Gulp Ruby SASS Version 2.1.0 Function: gulp.task('sass', function() { sass('C:/xampp/htdocs/bptc/vendor/bower_components/font-awesome/scss/font-awesome.scss', { trace: true, verbose: true }) …
AlGallaf
  • 627
  • 6
  • 15
  • 28
0
votes
2 answers

gulp-ruby-sass error The command line is too long

i have approximately 30 folders, every folder have scss file. i am compiling the scss using gulp-ruby-sass. still now it's working fine,today i created new scss file then it start giving the following error The command line is too long. i searched…
Ravin Singh D
  • 904
  • 10
  • 19
0
votes
1 answer

SASS compiling error using gulp

Using gulp watch, I get error for sass compiler module as following: [01:41:22] Using gulpfile D:\Workspace\WebDev\agaweed\public_html\wp-content\themes\master\gulpfile.js [01:41:22] Starting 'watch'... [01:41:23] Finished 'watch' after 26…
user1556571
0
votes
1 answer

Gulp Notify on Sass Error

I'm trying to get a notification when my gulp-ruby-sass compiler has an error. I've tried many of the suggestions found on here, but nothing gives me the error notification. I do receive the "task complete" notification so I know that notifications…
leclaeli
  • 139
  • 2
  • 6
0
votes
1 answer

Error with gulp-ruby-sass Error: must provide pattern

I'm using Ruby sass with PostCSS. This is my gulp css task. gulp.task('css', function () { var processors = [ short, rucksack, postcssmodules ]; return gulp.src('./css/src/*.scss') .pipe(postcss(processors, {syntax:…
Jitendra Vyas
  • 148,487
  • 229
  • 573
  • 852
0
votes
1 answer

gulp-json-sass - Cannot include json file

Source link - I don't know what is missing here Everything fine if I am not including json file 1) gulpfile.js var jsonSass = require('gulp-json-sass'), gulp = require('gulp'), concat = require('gulp-concat'), sass =…
ShibinRagh
  • 6,530
  • 4
  • 35
  • 57
0
votes
3 answers

Trying to integrate gulp SASS with gulp Autoprefixer-postcss, failing miserably

So, Autoprefixer has been bugging me to use the updated postcss version so I am trying to update my Gulp file. The problem is all the examples do not integrate Sass as the first step; I use gulp-ruby-sass. If I run my sass task on my sass directory…
Steve
  • 14,401
  • 35
  • 125
  • 230
0
votes
0 answers

Sourcemap wrong filename

I have an issue with my gulpfile.js when generating sourcemaps for my sass. When I use Developer Tools to inspect an element it's source is shown as _box-sizing.scss when it's true source is _header.sass. Here's an extract from my gulpfile.js var…
Mike Kaperys
  • 160
  • 1
  • 1
  • 9
0
votes
1 answer

Is it possible to have a scss file converted to an expanded and a compressed css file in gulp-ruby-sass?

Is it possible to have a scss file converted to an expanded and compressed css file? What I'd like to have is a bootstrap.scss file saved as boostrap.css and bootstrap.min.css I currently have the following code that will covert the scss file to a…
nablore
  • 49
  • 2
0
votes
1 answer

What does it mean that gulp-ruby-sass doesn't work with globbing?

Pretty simple here, I understand the basics of the statement, but how do I work around this? I use lots of file globbing in my sass. Please advise.
nizz0k
  • 471
  • 1
  • 8
  • 23
0
votes
1 answer

Gulp-sass or gulp-ruby-sass on win7, resolving syntax/dependency issues

So, like many people new to Gulp I'm struggling getting gulp-sass or gulp-ruby-sass working properly on my development machine (win7, xampp, drupal). My question is pretty simple: how can I get sass compilation with livereload to my browser? I can…
nizz0k
  • 471
  • 1
  • 8
  • 23
0
votes
0 answers

Getting 'File to import not found or unreadable' when running sass

I'm using gulp-ruby-sass and here's the code in gulpfile.js gulp.task('styles', function() { return sass('styles/app.scss', { style: 'expanded'}) .on('error', function(err) { console.log(err); …