最新Mac上如何安装pod
短信预约 -IT技能 免费直播动态提醒
在Mac上安装CocoaPods需要使用Ruby,请按照以下步骤操作:
- 安装rvm,这是 Ruby Version Manager 的缩写,它是一个命令行工具,用于安装不同版本的 Ruby。打开终端并输入以下命令:$ curl -L https://get.rvm.io | bash -s stable
jishaofngdeiMac:~ dongda$ curl -L https://get.rvm.io | bash -s stable % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed100 194 100 194 0 0 126 0 0:00:01 0:00:01 --:--:-- 126100 24532 100 24532 0 0 6681 0 0:00:03 0:00:03 --:--:-- 19736Downloading https://github.com/rvm/rvm/archive/1.29.12.tar.gzcurl: (92) HTTP/2 stream 1 was not closed cleanly before end of the underlying streamCould not download 'https://github.com/rvm/rvm/archive/1.29.12.tar.gz'. curl returned status '92'.Downloading https://bitbucket.org/mpapis/rvm/get/1.29.12.tar.gzDownloading https://bitbucket.org/mpapis/rvm/downloads/1.29.12.tar.gz.ascFound PGP signature at: 'https://bitbucket.org/mpapis/rvm/downloads/1.29.12.tar.gz.asc',but no GPG software exists to validate it, skipping.Installing RVM to /Users/dongda/.rvm/ Adding rvm PATH line to /Users/dongda/.profile /Users/dongda/.mkshrc /Users/dongda/.bashrc /Users/dongda/.zshrc. Adding rvm loading line to /Users/dongda/.profile /Users/dongda/.bash_profile /Users/dongda/.zlogin.Installation of RVM in /Users/dongda/.rvm/ is almost complete: * To start using RVM you need to run `source /Users/dongda/.rvm/scripts/rvm` in all your open shell windows, in rare cases you need to reopen all shell windows.Thanks for installing RVM 🙏Please consider donating to our open collective to help us maintain RVM.👉 Donate: https://opencollective.com/rvm/donate
如果有网络问题的话,你可以使用下如下命令:
curl --proxy http://127.0.0.1:19180 -L https://get.rvm.io | bash -s stable
- 执行source命令,让rvm生效
source /Users/dongda/.rvm/scripts/rvm
- 安装home-brew,这个非常简单,参考:https://brew.sh/index_zh-cn,实际就一行命令:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
在这个过程中可能会遇到下面这个问题:
error: RPC failed; curl 92 HTTP/2 stream 5 was not closed cleanly before end of the underlying streamerror: 7532 bytes of body are still expectedfetch-pack: unexpected disconnect while reading sideband packetfatal: early EOFfatal: fetch-pack: invalid index-pack output
解决方法:https://blog.csdn.net/qcx321/article/details/126013303
但是,之后还有问题,最后改用镜像地址:
/bin/bash -c "$(curl -fsSL https://raw.staticdn.net/Homebrew/install/HEAD/install.sh)"
安装成功之后提示如下:
==> Installation successful!==> Homebrew has enabled anonymous aggregate formulae and cask analytics.Read the analytics documentation (and how to opt-out) here: https://docs.brew.sh/AnalyticsNo analytics data has been sent yet (nor will any be during this install run).==> Homebrew is run entirely by unpaid volunteers. Please consider donating: https://github.com/Homebrew/brew#donations==> Next steps:- Run these two commands in your terminal to add Homebrew to your PATH: (echo; echo 'eval "$(/usr/local/bin/brew shellenv)"') >> /Users/dongda/.bash_profile eval "$(/usr/local/bin/brew shellenv)"- Run brew help to get started- Further documentation: https://docs.brew.sh
- 最后再执行安装cocoapods
sudo gem install cocoapods
安装前需要确保下ruby是最新版本:
192:~ dongda$ ruby --versionruby 2.6.10p210 (2022-04-12 revision 67958) [universal.x86_64-darwin21]# 安装最新ruby版本192:~ dongda$ rvm install ruby --latest
来源地址:https://blog.csdn.net/weixin_29003023/article/details/131358503
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341