找不到 gem sass (>= 0.a) 和可执行文件 sass

Can't find gem sass (>= 0.a) with executable sass

在最近 OS 更新到 High Sierra 之后。我在使用 SASS 和 G运行t.

时遇到问题

当我运行grunt

Running "sass:compressed" (sass) task
Traceback (most recent call last):
    2: from /usr/local/bin/sass:22:in `<main>'
    1: from /usr/local/Cellar/ruby/2.5.0/lib/ruby/2.5.0/rubygems.rb:308:in `activate_bin_path'
/usr/local/Cellar/ruby/2.5.0/lib/ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem sass (>= 0.a) with executable sass (Gem::GemNotFoundException)

我已尝试更新 ruby 并重新安装 g运行t:

> npm install grunt --save-dev
npm WARN grunt-contrib-imagemin@0.1.4 requires a peer of grunt@~0.4.0 but none was installed.
npm WARN grunt-contrib-sass@0.4.1 requires a peer of grunt@~0.4.0 but none was installed.
npm WARN grunt-contrib-uglify@0.2.7 requires a peer of grunt@~0.4.0 but none was installed.
npm WARN grunt-contrib-watch@0.4.4 requires a peer of grunt@~0.4.0 but none was installed.
npm WARN wb2012@0.0.0 No license field.

不知道为什么,但我不得不重新安装 sass gem install sass 并修复了它。

这个 sudo gem install sass -n /usr/local/bin 帮我修好了!