mac m2芯片 安装 brew 和cocoapods

Homebrew的安装

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

这里可能会失败,如

git clone 时候报错

error: RPC failed; curl 92 HTTP/2 stream 5 was not closed cleanly before end of the underlying st...

这是可能是因为buffer不够大

解决方案

git config --global http.version HTTP/1.1
git config --global http.postBuffer 524288000

也可能是因为网络原因网络中断,可以尝试多试几次。

中途可能需要输入几次密码

 安装成功 但还需要重启终端 或者 运行 下面命令, 否则可能无法使用

source /Users/用户名/.zprofile 

安装成功后,关闭终端,然后重新打开终端,查看Homebrew版本

brew -v

安装cocoapods

brew install cocoapods

在克隆代码的之前记得配置ssh密钥

ssh-keygen -t rsa -C "your_email@example.com"
#进入.ssh目录
$ cd ~/.ssh
#查看文件目录
$ ls 
#在终端查看私钥(私钥名称默认为id_rsa)
$ cat id_rsa
#在终端查看公钥(公钥名称默认为id_rsa.pub)
$ cat id_rsa.pub

但是在克隆工程的时候依然会出问题

Unable to negotiate with 10.112.17.38 port 22: no matching host key type found. Their offer: ssh-rsa

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

解决方案

1.打开.ssh文件夹
2.新建一个config文件,不带后缀名
3.加入如下内容
Host *
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值