jekyll和sass无法编译sass文件

时间:2015-04-11 16:38:38

标签: sass gruntjs jekyll jekyll-bootstrap

我刚刚使用a Yeoman generator启动了一个新的jekyll项目 它使用sass配置我无法使其工作

我在_sass文件夹中只有一个文件是main.scss,以

开头
@charset "utf-8";

但是当我发布grunt服务时,我得到了这个:

Running "copy:stageCss" (copy) task
[D] Task source: /Users/alexandresagette/Development/jekyll-site/node_modules/grunt-contrib-copy/tasks/copy.js
Verifying property copy.stageCss exists in config...OK
Options: encoding="utf8", processContent=false, processContentExclude=[], mode=false


Done, without errors.


Execution Time (2015-04-11 16:12:10 UTC)
loading tasks  1.1s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 99%
copy:stageCss   8ms  ▇ 1%
Total 1.1s
    Warning: Error: Invalid CSS after "@charset "utf-8"": expected "{", was ";"
        on line 4 of app/_sass/main.scss
  Use --trace for backtrace. Use --force to continue.

    Aborted due to warnings.

gruntfile可以在这里找到:https://github.com/robwierzbowski/generator-jekyllrb/blob/master/app/templates/Gruntfile.js

有人能帮助我吗?

1 个答案:

答案 0 :(得分:0)

我一个接一个地运行咕噜咕噜的服务任务,并且发现它实际上是笨蛋的任务:

    grunt --trace sass:server
Running "clean:server" (clean) task
>> 1 path cleaned.

Running "jekyll:check" (jekyll) task
`jekyll doctor` was initiated.


Jekyll output:
Configuration file: /Users/alexandresagette/Development/jekyll-site/_config.yml
  Your test results are in. Everything looks fine.

Running "sass:server" (sass) task
NoMethodError: undefined method `ascii_only?' for nil:NilClass
  Use --trace for backtrace.
Warning: Exited with error code 1 Use --force to continue.

Aborted due to warnings.


Execution Time (2015-04-11 18:06:30 UTC)
loading tasks  967ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 17%
jekyll:check    4.2s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 74%
sass:server    473ms  ▇▇▇▇▇▇▇▇▇▇▇▇ 8%
Total 5.6s