I'm working with gulp, I'm trying to install packages and the only way to install gulp on windows is to type npm install -g gulp#3.8.7 because new versions print me in the console some errors about the v8flags package.
So I'm trying to compile sass through Gulp. I've a gulpfile.js:
'use strict';
var gulp = require('gulp');
var sass = require('gulp-ruby-sass');
gulp.task('sass', function() {
return sass('css/main.scss')
.on('error', function (err) {
console.error('Error', err.message);
})
.pipe(gulp.dest('css/main.css'));
});
But Everytime I type "gulp sass" the console prints:
Error Missing the SASS executable. Please install and make it available on your PATH.
I have included the directory of my ruby bin in the PATH var (system variables within Enviroment variables).
I'm on Windows 8.1
ruby -v
ruby 1.9.3p545 (2014-02-24) [i386-mingw32]
node -v
v0.10.29
npm -v
1.4.14
sass -v
Sass 3.4.8 (Selective Steve)
I had the same problem. I did
sudo gem install sass
and that added the sass executable to my path.
Related
I'm trying to get gulp-compass to work on my Debian linux but am getting an error message stating that Ruby and Compass must be in the path. I am a bit of a beginner when it comes to Gulp so is probably me being stupid.
The following is the exact error message I get when running the task I create in my Gulpfile:
events.js:85
throw er; // Unhandled 'error' event
^
Error: You need to have Ruby and Compass installed and in your system PATH for this task to work.
Process finished with exit code 1
I've looked through other similar questions that suggest doing a gem install compass and a gem install sass but neither seem to work for me.
My Gulpfile is as follows:
var gulp = require('gulp'),
compass = require('gulp-compass');
gulp.task('stylesheets', function(){
return gulp.src('**/*.scss')
.pipe(compass({
config_file: './config.rb',
css: 'css',
sass: 'sass'
}))
.pipe(gulp.dest('css'));
});
I can runruby -v and compass -v I can see that these are correctly in my path and doing an echo $PATH shows that ruby is definitely there.
I am wondering if it is a problem to do with me installing ruby with RVM or the fact that I am using Bundler to install the gems in my project. My Gemfile is as follows:
source 'https://rubygems.org'
gem 'susy'
gem 'compass'
gem 'breakpoint'
I have installed the gems with bundle install and have also tried the bundle_exec: true option in gulp-compass (though truth be told I don't really know what this is for not being a Bundler expert). I have tried re-installing Ruby.
Has anyone any idea as to why I am getting the above error message? I've never had errors like this when doing similar with Grunt.
I've finally managed to get round this. I uninstalled RVM with rvm implode and then installed Ruby again with a regular apt-get install ruby.
Once I did this it all worked fine. I had to make a minor tweak to my gulpfile so it is now:
var gulp = require('gulp'),
compass = require('gulp-compass');
gulp.task('stylesheets', function(){
console.log();
return gulp.src('sass/**/*.scss')
.pipe(compass({
config_file: './config.rb',
css: 'css',
sass: 'sass'
}))
.pipe(gulp.dest('css'));
});
This isn't exactly an ideal as I'm now stuck with an older version of Ruby (ruby 2.1.5p273) when the current stable release (at time of writing) is 2.2.2. I'd rather use RVM but this will do for now.
i have recently implemented the grunt task runner on my Node.js project and i'm using grunt-contrib-compass and grunt-contrib-watch in order to compile my sass and compass code through grunt whenever i make any changes.
My grunt file is like this:-
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
compass: {
dist: {
options: {
sassDir: 'public/sass',
cssDir: 'public/css'
}
}
},
watch: {
css: {
files: '**/*.scss',
tasks: ['compass']
}
}
});
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default',['watch']);
}
I'm using windows and whenever i run grunt it watches for my sass files but whenever i make a change to these files i get this error:-
Warning: Couldn't find the 'compass.bat' binary. Make sure it's installed and in you $PATH Use --force to continue
I have installed ruby and compass through the ruby command prompt and the compass version is 1.0.3 and my gem installer version is 2.4.6. I have also tried including c:\Ruby200\bin to my Environmental variables and yes grunt-contrib-compass is installed in my Node.js project. I have tried everything, if anyone else has any experience in this i would love to hear from you. Thanks a lot.
You just need to install Ruby and follow this steps:
npm install grunt-contrib-compass
Reinstall Ruby gem installer 1.9.3 with checked all checkbox
On ruby console - gem install sass
On ruby console - gem install compass
I recently changed my mac. I used to worked with grunt and grunt-contrib-compass without issues but since i changed, compass doesn't work anymore.
I installed every tools i needed (ruby, compass, sass, xcode, command line tools, grunt ,etc ..) and kept the same gruntfile.js and configuration. When i run grunt, every task are executabe, even compass, but grunt-contrib-compass do nothing, it show this :
Running "compass:dev" (compass) task
//nothing
Running "csslint:dev" (csslint) task
>>1 file lint free.
// csslint, like the others plugins, works fine
The issue doesn't from my grunt configuration because in the same folder, grunt-contrib-compass work in my old mac.
I noticed xcodebuild doesn't run during grunt's execution.
Any idea where is my problem ?
Have you installed both Compass and SASS?
You should not install SASS if you have installed Compass:
// * for Compass, run `npm install --save-dev grunt-contrib-compass`
// This depends on the ruby compass gem, which can be installed with
// `gem install compass`
// You should not install SASS if you have installed Compass.
When running a compass task with Gulp (on OSX), I receive the following error. I've tried installing specific versions of both compass and sass (in various orders) without any notable effect.
[17:25:46] LoadError on line ["54"] of /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb: cannot load such file -- compass/import-once/activate
Run with --trace to see the full backtrace
events.js:72
throw er; // Unhandled 'error' event
^
Error: Compass failed
at Transform.<anonymous> (/Users/liamegan/Projects/WTC/nintendo.wethecollective.com/html/Websites/Kids/web/node_modules/gulp-compass/index.js:37:28)
at ChildProcess.<anonymous> (/Users/liamegan/Projects/WTC/nintendo.wethecollective.com/html/Websites/Kids/web/node_modules/gulp-compass/lib/compass.js:136:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket.<anonymous> (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:465:12)
My compass version is 0.12.7 and my sass version is 3.3.13 however I've also tried with sass 3.2.19.
My sass gulp process is as follows:
gulp.task('sass', function() {
gulp
.src('./_src/sass/screen.scss')
.pipe(compass({
config_file: './config.rb'
}))
.pipe(gulp.dest('./assets/css'))
})
Any help or insight would be greatly appreciated.
Cheers,
L
I fixed this with the following:
sudo gem uninstall sass
sudo gem uninstall compass
sudo gem install sass
sudo gem install compass --pre
This installed the prerelease version of compass which works with the latest, stable version of sass.
I have compass 1.0.0.alpha.18 installed with Sass 3.3.2 and Susy 2.0.0 and get
"Loaderror on line["45"] of C: cannot load such file --wdm"
The process that I am trying in the console is this:
gem install sass
gem install compass
When I do this, it tells me "successfully installed compass-0.12.3 but if I run compass --version I get Compass 1.0.0.alpha.18.
gem install susy
compass watch [my sass folder]
Returns: Compass is watching for changes
overwrite ../css/styles.css
Loaderror on line["45"] of C: cannot load such file --wdm
Any help would be greatly appreciated.