添加ruby PATH到环境变量仍然`grunt sass`不起作用

时间:2016-08-30 05:35:43

标签: ruby sass gruntjs grunt-contrib-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.

我认为这是有道理的,我需要添加路径到ruby,所以我做了。然后我检查了ruby的版本,它确实返回了一些东西

>ruby -v
ruby 2.2.5p319 (2016-04-26 revision 54774) [x64-mingw32]

这意味着我安装了ruby。现在咕噜咕噜应该工作,但它没有,我得到同样的旧信息。 这一个:

>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.

2 个答案:

答案 0 :(得分:1)

您似乎需要使用sass安装gem install sass。如果没有宝石,你就无法在红宝石中使用sass。

答案 1 :(得分:0)

Sass最初是使用ruby programming language构建的。在node构建系统上运行Sass(即,gruntgulpwebpack)需要同时运行rubySass连接它们(即,grunt-contrib-sassgulp-sasssass-loader)。

Ruby插件名为gems,安装插件很简单:

gem install sass

另一方面,libsassc Sass的{​​{1}}实现,不需要ruby。安装libsass后,您需要一种方法将libsass连接到node。您可以使用node-sass执行此操作。

npm install node-sass

最后,LESSSass的竞争者,node运行ruby,不需要libsassdad.Fill(dtb) ' set the check chkInUse.Checked = (dtb.Rows(0).Field(Of String)("IN_USE") = "YES")