美文网首页
2025-04-26 Mac os M2芯片 15.4系统coc

2025-04-26 Mac os M2芯片 15.4系统coc

作者: Mr_墨 | 来源:发表于2025-04-25 17:41 被阅读0次

卸载老版本cocoapods

sudo gem uninstall cocoapods

查看本地安装过的cocopods相关东西

gem list --local | grep cocoapods

cocoapods-core(1.9.1)

cocoapods-deintegrate(1.0.4)

cocoapods-downloader(1.3.0)

cocoapods-plugins(1.0.0)

cocoapods-search(1.0.0)

cocoapods-stats(1.1.0)

cocoapods-trunk(1.4.1)cocoapods-try(1.1.0)

sudo gem uninstall cocoapods-core 依次删除

或者/usr/bin/ruby和 /usr/local/bin和/usr/local/var/ 删除干净

重新安装cocoapods

安装顺序 homebrew —> rvm —> ruby —> cocoapods

1、安装brew

/bin/bash-c"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

$ brew search wget

==>Formulaewget 

 $ brew install wget

$ brew list

2、 brew安装rvm

$ curl-L https://get.rvm.io | bash-s stable

curl:(7)Failedtoconnecttoraw.githubusercontent.com port443:Connection refused

解决以上报错:

sudo chmod777/etc/hosts

vi/etc/hosts

添加如下homebrew的网址主机映射

199.232.68.133raw.githubusercontent.com

Thanksforinstalling RVM 🙏看到这个恭喜你成功了

载入 RVM 环境

$ source ~/.rvm/scripts/rvm

检查一下是否安装正确$ rvm-v

可以先查询已经安装的ruby

$ rvm list

如果有安装过,则先卸载已安装版本

$ rvm remove1.9.2

列出已知的ruby版本

$ rvm list known

[ruby-]2.0.0[-p648]

[ruby-]2.1[.10]

[ruby-]2.2[.10]

[ruby-]2.3[.8]

[ruby-]2.4[.9]

[ruby-]2.5[.7]

[ruby-]2.6[.5]

[ruby-]2.7[.0]

ruby-head

开始安装ruby

$ rvm install 2.6.5

检测是否正确

$ ruby-v

$ gem-v

设置Ruby默认版本RVM 装好以后,需要执行下面的命令将指定版本的 Ruby 设置为系统默认版本

$ rvm 3.3.6--default

切换gem下载源:

$ gem sources-l

# 确保只有 gems.ruby-china.com

https://gems.ruby-china.com

4、安装cocoapods

# Mac OS X 10.11前

sudo gem install cocoapods

# Mac OS X 10.11后

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

$ pod search Masonry

完成

相关文章链接

https://blog.51cto.com/u_16213360/13608659

https://www.jianshu.com/p/7066b5756a35

相关文章

网友评论

      本文标题:2025-04-26 Mac os M2芯片 15.4系统coc

      本文链接:https://www.haomeiwen.com/subject/fwuobjtx.html