gulp compass throws error -
i trying use gulp-compass
plugin convert , minify scss css. getting below error:
$ gulp compass [02:14:32] using gulpfile c:\users\dell\desktop\sassy - copy\gulpfile.js [02:14:32] starting 'compass'... [02:14:32] finished 'compass' after 13 ms [02:14:33] loaderror on line ["55"] of c: cannot load such file -- bourbon run --trace see full backtrace
events.js:160 throw er; // unhandled 'error' event ^ error: compass failed
this how scss file looks like:
.scss file:
@import 'bower_components/bourbon/app/assets/stylesheets/bourbon'; @import 'bower_components/normalize-css/normalize'; @import 'bower_components/susy/sass/susy'; @import url('https://fonts.googleapis.com/css?family=playfair+display|raleway'); @import 'partials/variables'; @import 'partials/base'; @import 'partials/footer'; @import 'partials/header'; @import 'partials/layout'; @import 'partials/modules';
following gulpfile.js:
var gulp = require('gulp'), compass = require('gulp-compass'), minifycss = require('gulp-minify-css'); gulp.task('compass', function() { gulp.src('assets/scss/styles.scss') .pipe(compass({ sass: 'assets/sass', image: 'images', require:['bourbon', 'normalize','susy'] })) .pipe(minifycss()) .pipe(gulp.dest('css')); });
i guess not letting plugins bourbon
, normalize
,susy
compile , convert. might have done wrong configuration guess.
tried installing gems throws following error:
gem install susy
gem install bourbon
c:\users\dell\desktop\sassy - copy>gulp compass [23:23:59] using gulpfile c:\users\dell\desktop\sassy - copy\gulpfile.js [23:23:59] starting 'compass'... [23:23:59] finished 'compass' after 14 ms error assets/sass/styles.scss (line 1: file import not found or unreadable: bower_components/bourbon/app/assets/stylesheets/bourbon. load paths: compass::spriteimporter c:/users/dell/desktop/sassy - copy/assets/sass c:/ruby24/lib/ruby/gems/2.4.0/gems/compass-core-1.0.3/stylesheets c:/ruby24/lib/ruby/gems/2.4.0/gems/susy-2.2.12/sass c:/ruby24/lib/ruby/gems/2.4.0/gems/bourbon-4.3.4/app/assets/stylesheets) compilation failed in 1 files. events.js:160 throw er; // unhandled 'error' event ^ error: error assets/sass/styles.scss (line 1: file import not found or unreadable: bower_components/bourbon/app/assets/stylesheets/bourbon. load paths: compass::spriteimporter c:/users/dell/desktop/sassy - copy/assets/sass c:/ruby24/lib/ruby/gems/2.4.0/gems/compass-core-1.0.3/stylesheets c:/ruby24/lib/ruby/gems/2.4.0/gems/susy-2.2.12/sass c:/ruby24/lib/ruby/gems/2.4.0/gems/bourbon-4.3.4/app/assets/stylesheets) compilation failed in 1 files.
the reason quite simple, required ruby gems, not bower or node libraries.
from doc,
require given ruby library before running commands. used access compass plugins without having project configuration file.
if not install ruby gems, can require them.
gem install susy gem install bourbon
it seems normalize-css not have ruby gem.
the new error:
this question may why compass giving me import error when trying import partials, need use relative path, otherwise search required ruby gem path.(i think have bower packages installed).
so changes @import 'bower_components/bourbon/app/assets/stylesheets/bourbon';
to
@import './bower_component/..
, things alike.
Comments
Post a Comment