如何解决“您需要在 PATH 中安装 Ruby 和 Sass 才能执行此任务"警告? [英] How to resolve "You need to have Ruby and Sass installed and in your PATH for this task to work" Warning?
问题描述
我正在设置一台新的 Mac 以供工作.我已经安装了 Grunt &全局 Grunt CLI.然后我在项目文件夹中执行了 npm install
以安装所有依赖项.
I am in the process of setting up a new Mac for work. I have installed Grunt & Grunt CLI globally. Then I did a npm install
inside a project folder to install all dependencies.
到目前为止没有问题,但是一旦我尝试运行 sass:dist
任务,我就会收到此警告:
No problems so far, but as soon as I try to run the sass:dist
task, I get this warning:
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.
我的理解是,我需要在更全局的级别上安装 Ruby 和 Sass,才能运行此任务.由于我对使用终端还是很陌生,因此我进行了快速搜索以找出 PATH
是什么 - 似乎它是一些存储重要数据的系统路径(可以更改).
What I understand is that I need to have Ruby and Sass installed on a more global level for this task to run. As I am still pretty new to working with the terminal, I did a quick search to find out what PATH
is - seems like its some system path (that can be changed) where important data is stored.
这是否意味着我可以简单地执行 sudo grunt install contrib-sass -g
来解决问题?那么 Ruby 呢?我一直认为它已经安装在 OS X 上?
Does this mean I can simply do a sudo grunt install contrib-sass -g
to resolve the issue? And what about Ruby – I always thought its already installed on OS X?
推荐答案
好的,我明白了.我只需要使用 gem install sass
安装 Sass,现在一切都很好......再简单不过了.
Ok I got it. I just had to install Sass using gem install sass
and now everything is fine...couldn't be easier.
这篇关于如何解决“您需要在 PATH 中安装 Ruby 和 Sass 才能执行此任务"警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!