草庐IT

ruby - 如何解决 "You need to have Ruby and Sass installed and in your PATH for this task to work"警告?

coder 2025-04-05 原文

我正在为工作设置一台新 Mac。我已经在全局范围内安装了 Grunt & Grunt CLI。然后我在项目文件夹中执行了 npm install 以安装所有依赖项。

到目前为止没有问题,但是当我尝试运行 sass:dist 任务时,我收到了这个警告:

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 是什么 - 似乎是存储重要数据的某个系统路径(可以更改)。

这是否意味着我可以简单地执行 sudo grunt install contrib-sass -g 来解决问题?那么 Ruby 呢?我一直认为它已经安装在 OS X 上了?

最佳答案

好的,我明白了。我只需要使用 gem install sass 安装 Sass,现在一切都很好......再简单不过了。

关于ruby - 如何解决 "You need to have Ruby and Sass installed and in your PATH for this task to work"警告?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20176410/

有关ruby - 如何解决 "You need to have Ruby and Sass installed and in your PATH for this task to work"警告?的更多相关文章

随机推荐