mac 安装sass过程总结

项目场景:

今天心血来潮给mac上准备安装一下sass,以前都是项目中有所以也就没有安装,今天安装了一下各种报错,简单的记录一下

问题描述:

一、运行 gem install sass
然后就是各种错误,懵逼了我不知道怎么继续下去了,只能在网上搜索可行的方案,结果找到了说是ruby的版本太低了,好吧 !那就升级ruby!
运行gem install sass 错误显示结果
1、更新 brew

 brew update

然后又是各种报错,太难了我!

Error: 
  homebrew-cask is a shallow clone.
To `brew update`, first run:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
This command may take a few minutes to run due to the large size of the repository.
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!
....

2、升级brew
整合了一下搜索的方案,说是只要删除homebrew-core后更新即可,安排上吧

cd /usr/local/Homebrew/Library/Taps/homebrew
rm -rf homebrew-core
brew upgrade

这一顿操作完之后又又出现问题了:

Error: 
  homebrew-cask is a shallow clone.
To `brew update`, first run:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
This command may take a few minutes to run due to the large size of the repository.
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!
==> Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
fatal: unable to access 'https://github.com/Homebrew/homebrew-core/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 

我去文件夹看了看,homebrew-core这个文件夹不见了,哦哦,刚才被我删除了,没辙了我就直接克隆一个好了

mkdir homebrew
git clone https://github.com/Homebrew/homebrew-core /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1

安装成功信息
3、查看brew是否成功
另起窗口,输入brew
brew成功
OK,自此brew升级成功!


二、升级ruby
1、通过brew升级ruby

brew install ruby

然后跟新版本

echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
ruby -v

ruby 更新成功
2、安装sass

gem install sass

额,又又又出问题了

sass-v

zsh: command not found: sass
查看一下组件安装了没有

gem list

在这里插入图片描述
安装了那就说明没有关联到:

export PATH="/usr/local/lib/ruby/gems/3.0.0/bin:$PATH"
sass-v

在这里插入图片描述
OK,至此安装完成,搞定,实在是太难了!

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值