Running a compass task with gulp results in a LoadError - ruby

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.

Related

gulp-compass asking for Ruby and Compass in PATH when they are already there

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.

Gulp missing the SASS executable

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.

Warning: spawn ENOENT Use with Grunt sass task

I recently downloaded OSX Yosemite and now grunt-contrib-sass is not working and I am getting the error:
Running "sass:dist" (sass) task
Warning: spawn ENOENT Use --force to continue.
Aborted due to warnings.
I'm not a grunt expert, do I need to reinstall any plugins or something else? I'm happy to provide any other information if needed. Thanks.
Adding it as an answer here from comments above for posterity.
That error usually means Sass isn't installed. Run gem install sass to install it.
For me, it kept failing to install, so ran gem install sass --debug --backtrace --verbose and that fixed the no implicit conversion of nil into String (TypeError) install error.
I noticed that running compass directly threw an exception, so I uninstalled compass and reinstalled it (making sure to delete all compass binaries on PATH) and that fixed it.

Load error with Susy - Sass - Compass - watch

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.

Ruby and compass path with yeoman project

I installed ruby, yeoman, and when I run my project, I have this error:
Warning: Running "compass:dist" (compass) task
Warning: You need to have Ruby and Compass installed
this task to work. More info: https://github.com/gru
Use --force to continue. Use --force to continue.
I have the path into the variable session target, but it doesn't work. Can anyone help me?
I had to run this:
gem install compass
Found here: Angular with Yeoman 1.0 and Grunt
(I thought I had Compass installed by following the instructions here but it wasn't sufficient.)
The problem comes from compass being called compass2.0
I solved the issue by symlinking compass to compass2.0
Here's the command: sudo ln -s /usr/bin/compass2.0 /usr/bin/compass
Hope this helps
I was getting the same error. Turns out it was masking the real error:
{ '0': [Error: Error: not found: bundle],
'1':
{ stdout: '',
stderr: 'Error: not found: bundle',
code: 127,
toString: [Function] },
'2': 127 }
Fixed with:
sudo gem install bundle --no-user-install
I had the same issue on Windows 7 too..
This is what I did.
Install Ruby with Ruby installer
Install the Compass with gem, (Installing the compass with npm didnt have any effect)
gem install compass

Resources