使用Gulp运行指南针任务时(在OSX上),我收到以下错误。我已经尝试安装指南针和sass的特定版本(以各种顺序),没有任何显着的效果。
[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)
我的指南针版本是0.12.7,我的sass版本是3.3.13但是我也尝试使用sass 3.2.19。
我的sass gulp流程如下:
gulp.task('sass', function() {
gulp
.src('./_src/sass/screen.scss')
.pipe(compass({
config_file: './config.rb'
}))
.pipe(gulp.dest('./assets/css'))
})
非常感谢任何帮助或见解。
干杯, →
答案 0 :(得分:3)
我用以下内容解决了这个问题:
sudo gem uninstall sass
sudo gem uninstall compass
sudo gem install sass
sudo gem install compass --pre
这安装了指南针的预发布版本,它与sass的最新稳定版本一起使用。