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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容