cocopod安装操作遇到的坑

1.升级ruby环境

$ sudo gem update --system

2.使用淘宝的RubyGems镜像

///删除之前的镜像

$ gem sources --remove https://rubygems.org/

 ///等有反应之后再敲入以下命令

$ gem sources -a https://ruby.taobao.org/

注意:如果写入镜像失败,出现如下错误

ERROR:  SSL verification error at depth 0: certificate has expired (10)

改用:

$ gem sources -a https://gems.ruby-china.org/

如果上面步骤出现下面错误

Error fetching https://gems.ruby-china.org/: bad response Not Found 404

由于域名备案导致,改用:

$ gem sources -a https://gems.ruby-china.com/

3.查看镜像

$ gem sources -l

4.安装或更新cocopod

$ sudo gem install cocoapods

5.cd到你的项目里面

$ cd /Volumes/WXG2/projects/OC_Small_Project/AFNetWorking_SecondaryPackaging

6.建立Podfile

$ vim Podfile

7.在Podfile里面输入如下:

platform :ios, '8.0'

target "项目名" do

pod 'AFNetworking'

end

8.然后按Esc,并且输入“ :”号进入vim命令模式,然后在冒号后边输入wq

9.最后执行cocopod就行了

$ pod install

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容