好的,首先我做了这个。
>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.发布于 2016-08-30 17:46:52
看起来您需要在gem install sass中安装sass。没有宝石,你就不能在ruby中使用sass。
发布于 2016-08-30 23:47:43
Sass最初是使用ruby programming language构建的。在node构建系统(如grunt、gulp、webpack)上运行Sass需要同时运行ruby和Sass以及连接它们的方法(如grunt-contrib-sass、gulp-sass、sass-loader)。
Ruby插件被称为gems,安装插件很容易:
gem install sass另一方面,libsass是不需要ruby的Sass的c实现。安装libsass后,您需要一种将libsass连接到node的方法。您可以使用node-sass来实现这一点。
npm install node-sass最后,LESS是运行在node上的Sass的竞争对手,它不需要ruby或libsass。
https://stackoverflow.com/questions/39219437
复制相似问题