Mac OS 10.12系统cocoapods安装

从git上下载的项目运行后:The file “Pods.xcconfig” couldn’t be opened because there is no such file.

1、检查当前ruby版本

$gem sources -

成功后提示:

*** CURRENT SOURCES ***

https://ruby.taobao.org/

否则,移除现有的ruby:$gem sources --remove https://rubygems.org/;添加使用淘宝镜像:$gem sources -a https://ruby.taobao.org/

2、开始安装cocoapods

$sudo gem install cocoapods

运行后出现错误

2.1检查ruby版本

$ruby -v

ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]

2.2需要升级ruby;

    查看目前所有ruby版本:$rvm list known 如果提示command not found

    $curl -L get.rvm.io | bash -s stable

    请先安装rvm:rvm install 2.2.2 ;如果不成功,检查homebrew卸载安装

    卸载:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Failed to locate Homebrew!

 

解决问题:删除原来的安装目录

rm -rf Cellar Frameworks Homebrew

重新执行安装:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

运行后有下边提醒,则出现安装成功:

==> Installation successful!

 在执行:$ rvm install 2.2.2

运行结果:

Please be aware that you just installed a ruby that requires        1 patches just to be compiled on an up to date linux system.

This may have known and unaccounted for security vulnerabilities.

Please consider upgrading to ruby-2.3.0 which will have all of the latest security patches.

Ruby was built without documentation, to build it run: rvm docs generate-ri成功

之后就开始安装cocoapods:$sudo gem install cocoapods

结果:

Installing ri documentation for cocoapods-1.0.1

Done installing documentation for nap, fourflusher, escape, colored, concurrent-ruby, thread_safe, tzinfo, i18n, activesupport, claide, xcodeproj, molinillo, cocoapods-try, netrc, cocoapods-trunk, cocoapods-stats, cocoapods-search, cocoapods-plugins, cocoapods-downloader, cocoapods-deintegrate, fuzzy_match, cocoapods-core, cocoapods after 146 seconds

23 gems installed

则安装成功 》

谨记:运行pod install时总是卡在Setting up CocoaPods master repo,因为这条命令被墙了,换成pod install --verbose --no-repo-update

pod update --- > pod update --verbose --no-repo-update



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值