首页 > 其他 > 详细

cocoapods 更新

时间:2018-01-23 23:04:26      阅读:271      评论:0      收藏:0      [点我收藏+]

总共就下面几个命令行

sudo gem update --system
gem sources --remove https://rubygems.or
gem source -a https://gems.ruby-china.org/
sudo gem install -n /usr/local/bin cocoapods
pod setup
pod --version
pod search AFNetWorking

升级Ruby环境

gem update --system
若报错 
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.

则把上面的命令行换成
sudo gem update --system

更换Ruby镜像

// 检查现有 Ruby镜像
gem sources -l
如果结果是 
*** CURRENT SOURCES ***
https://gems.ruby-china.org/
就不需要替换了,否则就要替换,执行下面命令
// 移除现有镜像
gem sources --remove https://rubygems.or
// 添加国内镜像
gem source -a https://gems.ruby-china.org/
// 检查是否替换成功
gem sources -l

安装 Cocoapods

sudo gem install cocoapods
若出现
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/bin directory.
则换成下面的命令行
sudo gem install -n /usr/local/bin cocoapods

建立索引库

pod setup

查看版本

pod --version

cocoapods 更新

原文:https://www.cnblogs.com/shidaying/p/8338089.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!