文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

最新Mac上如何安装pod

2023-08-19 19:00

关注

在Mac上安装CocoaPods需要使用Ruby,请按照以下步骤操作:

  1. 安装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
  1. 执行source命令,让rvm生效
source /Users/dongda/.rvm/scripts/rvm
  1. 安装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
  1. 最后再执行安装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

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-后端开发
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯