【发布时间】:2017-01-06 06:18:57
【问题描述】:
好的,我先这样做了。
>grunt sass
Running "sass:dist" (sass) task
Warning:
You need to have Ruby and Sass installed and in your PATH for this task to work.
More info: https://github.com/gruntjs/grunt-contrib-sass
Use --force to continue.
Aborted due to warnings.
我认为这是有道理的,我需要添加 ruby 的路径,所以我做到了。然后我检查了 ruby 的版本,它确实返回了一些东西
>ruby -v
ruby 2.2.5p319 (2016-04-26 revision 54774) [x64-mingw32]
这意味着我已经安装了 ruby。现在 grunt sass 应该可以工作,但它没有,我收到了同样的旧消息。 这个:
>grunt sass
Running "sass:dist" (sass) task
Warning:
You need to have Ruby and Sass installed and in your PATH for this task to work.
More info: https://github.com/gruntjs/grunt-contrib-sass
Use --force to continue.
Aborted due to warnings.
更新
当我运行grunt-sass-force 时,我得到了关注:
>grunt sass --force
Running "sass:dist" (sass) task
Warning:
You need to have Ruby and Sass installed and in your PATH for this task to work.
More info: https://github.com/gruntjs/grunt-contrib-sass
Used --force, continuing.
'sass' is not recognized as an internal or external command,
operable program or batch file.
Warning: Exited with error code 1 Used --force, continuing.
Done, but with warnings.
【问题讨论】:
-
当您使用
--force时会发生什么?你安装sass了吗? -
@zhon 你的意思是这样的:
grunt sass --force?当我执行grunt-sass-force>grunt sass --force Running "sass:dist" (sass) 任务时,我得到了关注 警告:您需要安装 Ruby 和 Sass 并在您的 PATH 中才能执行此任务。更多信息:github.com/gruntjs/grunt-contrib-sass 使用 --force,继续。 'sass' 不是内部或外部命令、可运行程序或批处理文件。警告:以错误代码 1 退出已使用 --force,继续。完成,但有警告。 -
你安装了
sassgem吗? -
@zhon 感谢帮助,我没有
sass。
标签: ruby sass gruntjs grunt-contrib-sass