安装cocoapods相关问题
一.Homebrew
Homebrew官网,即使翻墙也下不下来,不推荐
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
国内有人做了一键安装,中科大国内源比较快
CunKai / HomebrewCN(国内一键安装)
Homebrew国内如何自动安装(国内地址)(Mac & Linux)
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
安装完成后brew -v
如果有如下报错
Homebrew 3.6.13-34-g001bace
fatal: detected dubious ownership in repository at '/opt/homebrew/Library/Taps/homebrew/homebrew-core'
To add an exception for this directory, call:
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core
Homebrew/homebrew-core (no Git repository)
fatal: detected dubious ownership in repository at '/opt/homebrew/Library/Taps/homebrew/homebrew-cask'
To add an exception for this directory, call:
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask
Homebrew/homebrew-cask (no Git repository)
按照提示执行命令即可
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask
二.RVM
rvm官网
\curl -sSL https://get.rvm.io | bash -s stable
三.Ruby
ruby语言官网
1.rvm list known
2.rvm install 版本号
(例如rvm install 3.0.0
)
换源(现在好像不换源也可以了):
1.gem sources -l
2.gem sources --remove https://rubygems.org/
3.gem sources -a https://gems.ruby-china.com/
四.Cocoapods
cocoapods官网
sudo gem install cocoapods
pod setup
如果需要删除搜索索引缓存,执行 rm ~/Library/Caches/CocoaPods/search_index.json
如果repo总是下载不下来(建议使用CDN,不用下载repo,使用CDN需要经常改hosts,链接github):
1.cd ~/.cocoapods/repos
2.git clone --depth 1 https://github.com/CocoaPods/Specs.git master
3.pod setup
参考文章
2023安装CocoaPods
2021最新cocoaPods、Homebrew、RVM、Ruby 安装教程
use_frameworks
use_frameworks!遇到了library not found for -lXXXXX 的解决方法 - 简书
use_frameworks!的坑 - 简书
use_frameworks!和#use_frameworks!的区别 - 简书
警告
[iOS开发-pod删除库后终端警告[!] The xxxx [Debug]
target overrides the `EXCLUDED_ARCHSsdk=iphonesimulator*... - 简书
Trunk CDN问题
1.使用CDN:
Cocoapods1.9.1 trunk、 CDN错误 2020-04-20
cocoapods cdn trunk 报错问题
CocoaPods1.9.1和1.8+ 使用 出现CDN: trunk URL couldn't be downloaded:
2.不适用CDN
解决 CocoaPods trunk CDN 连接不上的问题
网友评论