【问题标题】:Compass and Susy require a different version of SassCompass 和 Susy 需要不同版本的 Sass
【发布时间】:2014-04-28 15:45:26
【问题描述】:

我正在开发我的网站,我想使用 Susy 和 Compass。我也在使用 Grunt。当我运行我的 grunt 任务时,我收到了这个错误:

Denniss-MacBook-Pro:portfolio dennis$ grunt --trace
Running "compass:dev" (compass) task
Gem::LoadError on line ["1990"] of /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb: Unable to activate susy-2.1.1, because sass-3.2.17 conflicts with sass (~> 3.3.0)
Run with --trace to see the full backtrace
Warning: ↑ Use --force to continue.

Aborted due to warnings.

这是我的 Grunt 文件:

module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

watch: {
  options: {
    livereload: true
  },
  css: {
    files: ['_sass/*.{scss,sass}'],
    tasks: ['compass:dev']
  },
  js: {
    files: ['js/*.js'],
    tasks: ['uglify']
  }
},

compass: {
  options: {
    require: 'susy'
  },
  dev: {
    options: {
      sassDir: ['_sass'],
      cssDir: ['css'],
      environment: 'development',
    }
  },

  production: {
    options: {
      sassDir: ['_sass'],
      cssDir: ['css'],
      outputStyle: 'compressed',
      environment: 'production',
    }
  }
},

uglify: {
  all: {
    files: {
      'js/main.min.js': [
      'js/libs/*.js',
      'js/src/*.js'
      ]
    }
  }
},

connect: {
  port: 8000
}
  });

  grunt.loadNpmTasks('grunt-contrib-compass');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-connect');

  grunt.registerTask('default', ['compass:dev', 'uglify','connect', 'watch']);
  grunt.registerTask('production', ['compass:production', 'uglify']);
}

我只是不知道该怎么办,提前谢谢!

【问题讨论】:

    标签: sass gruntjs susy-compass grunt-contrib-compass


    【解决方案1】:

    存在依赖不兼容的问题: susy 2.0.0 依赖于 sass ~> 3.3.0 罗盘 0.12.3 取决于 sass = 3.2.14

    您可以通过以下方式列出所有宝石:

    gem list
    

    尝试这样做:

    gem install compass --pre
    

    这应该可行。

    【讨论】:

    • 不可行.. grunt-compass 可以修复 require 的版本吗?
    猜你喜欢
    • 2014-09-13
    • 2012-03-17
    • 2014-04-13
    • 2012-11-07
    • 2014-09-30
    • 2012-12-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多