gem 升级
翻墙的前提下
sudo gem update --system
// 查看版本
gem -v
2.6.7
貌似gem 升级之后需要重新换源
cocoPods 换镜像源
// 添加新的,移除旧的
gem sources --add https://gems.ruby-china.org/ --remove https://ruby.taobao.org/
// 结果
https://gems.ruby-china.org/ added to sources
https://ruby.taobao.org/ removed from sources
// 查询现在的源
gem source -l
// 结果
*** CURRENT SOURCES ***
https://gems.ruby-china.org/
cocoPods 升级
1. sudo gem install -n /usr/local/bin cocoapods
成功
2. 重启之后 command+r 进入一个特殊界面 在工具中找到终端 然后打开
终端下 csrutil disable // 修改权限 (csrutil enable 开启)
reboot // 重启
回到正常界面
sudo gem install cocoapods
成功
随后
pod setup
pod –version
问题
-
傻逼问题第一条
rm -rf 命令不要用,问题很严重 -
pod 安装问题
pod 文件内容 target 'App' do pod 'Artsy+UIColors' pod 'Artsy+UIButtons' pod 'FLKAutoLayout' pod 'ISO8601DateFormatter', '0.7' pod 'AFNetworking', '~> 2.0' target 'AppTests' do inherit! :search_paths pod 'FBSnapshotTestCase' pod 'Quick' pod 'Nimble' end end 升级之后是这种格式pod install 时遇到下列问题
[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master`. You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`. 解决方式 cd ~/.cocoapods/repos git clone https://github.com/CocoaPods/Specs.git master git clone 时遇到问题 error: RPC failed; curl 56 SSLRead() return error -98068.00 KiB/s fatal: The remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed 解决方法是 1. 如果只有一个Xcode时 sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer 多个时 可以更改相应的版本号 sudo xcode-select -switch /Applications/Xcode 7.3.1.app/Contents/Developer 如果还不行,就重装Xcode 2. 第一个方法不行 git config --global http.postBuffer 524288000 或者 git config --global http.postBuffer 1048576000 3. 以上方法都失败了。暂无解决之道
最后
由于我意外的删除了user下面的所有数据。出了很多莫名其妙的问题,最后我重新开始了一个新的用户重新在
cd ~/.cocoapods/repos 后,pod setup 失败。
我重新下载 https://github.com/CocoaPods/Specs.git 文件,并导入此文件夹即可。











网友评论