MAC升级mojave导致sass无法安装使用

升级完系统,发现一些问题,如sass无法使用了:
先解决这个问题:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

解决方法,重装xcode command line:

 xcode-select --install

这里如果命令安装不了,可以手动下载 Command_Line_Tools_macOS_10.14_for_Xcode_10.1
如果没有解决问题,执行以下命令

sudo xcode-select -switch /

升级ruby

 brew install ruby

查看sass版本,报一下错误:

image.png

接下来我升级了gem
image.png

gem如果出现这种情况,由于sources源问题导致

huangjihua@huangjihuadeMacBook-Pro-2  ~  gem update --system
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    bad response Not Found 404 (https://gems.ruby-china.org/specs.4.8.gz)

huangjihua@huangjihuadeMacBook-Pro-2  ~  gem sources
*** CURRENT SOURCES ***

https://gems.ruby-china.org
https://gems.ruby-china.com/

huangjihua@huangjihuadeMacBook-Pro-2  ~  gem sources --remove https://gems.ruby-china.org
https://gems.ruby-china.org removed from sources
huangjihua@huangjihuadeMacBook-Pro-2  ~  gem update --system
Latest version already installed. Done.

升级gem出现了错误


image.png

升级完之后,重新安装sass

sudo gem install -n /usr/local/bin sass

大功告成!


image.png

你可能感兴趣的:(MAC升级mojave导致sass无法安装使用)