【问题标题】:Grunt compass not compiling and not respondingGrunt compass 未编译且未响应
【发布时间】:2015-04-09 23:43:08
【问题描述】:

我的 grunt-contrib-compass 似乎无法正常工作, 我正在尝试使用:

grunt compass:dev

输出是:

Running "compass:dev" (compass) task

但是什么也没发生,我也没有出错

在我的Gruntfile.js 我有:

compass: {
  dev: {
    options: {
      sassDir: 'src/assets/sass',
      cssDir: 'src/assets/css',
      imagesDir: 'assets/images',
      outputStyle: 'nested',
      environment: 'development',
      force: true
    }
  },
  dist: {
    options: {
      sassDir: 'src/assets/sass',
      cssDir: 'src/assets/css',
      imagesDir: 'assets/images',
      outputStyle: 'compressed',
      noLineComments: true,
      environment: 'production'
    }
  }
}

使用:

grunt compass:dev --verbose

我明白了:

Running "compass:dev" (compass) task
Verifying property compass.dev exists in config...OK

File: [no files]
Options: sassDir="src/assets/sass/", cssDir="src/assets/css",` imagesDir="assets/images", outputStyle="nested", environment="development",`

有什么想法吗?

谢谢!

【问题讨论】:

  • 使用详细标志 (grunt compass:dev --verbose) 运行任务时的输出是什么?
  • 这是我的输出结果:Running "compass:dev" (compass) task Verifying property compass.dev exists in config...OK File: [no files] Options: sassDir="src/assets/sass/", cssDir="src/assets/css", imagesDir="assets/images", outputStyle="nested", environment="development", force
  • 看来是路径问题 - 它没有找到任何文件。
  • 是的,它看起来是,但我在 src/assets/sass/ 上获得了 .sass 文件,刚刚检查过
  • 这是 ruby​​ 版本的问题,我将我的 ruby​​ 版本更改为 ruby-2.2.0-preview1,现在可以了 :)

标签: sass gruntjs compass grunt-contrib-compass


【解决方案1】:

遇到完全相同的问题,但原因不同。

一个好的故障排除方法是确保罗盘单独运行良好。你可以在终端上试试这个命令

compass compile your_sass_file.scss

我的给了一个奇怪的错误信息

Interrupt on line ["18"] of /Users/mynamehere/.rvm/gems/ruby-2.1.3/gems/compass-rails-2.0.0/lib/compass-rails.rb: 
[...]

原来 compass-rails-2.0.0 需要升级才能正常工作

希望对某人有所帮助

【讨论】:

  • OP 从不表示他们正在使用 RoR,您的回答与问题无关。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-02-14
  • 2018-11-18
  • 2014-01-07
  • 1970-01-01
  • 1970-01-01
  • 2014-10-21
  • 1970-01-01
相关资源
最近更新 更多