iOS OS X EL Capitan安装CocoaPods遇过的坑

1.移除现有Ruby默认源

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

2.使用新的源

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

3.验证新源是否替换成功

$gem sources -l

4.安装CocoaPods

(1)  $sudo gem install cocoapods 备注:苹果系统升级 OS X EL Capitan 后改为  $sudo gem install -n /usr/local/bin cocoapods

      (2)  $pod setup

5.更新gem

$sudo gem update --system


错误1:

Error fetchinghttp://ruby.taobao.org/:

bad response Not Found 404 (http://ruby.taobao.org/specs.4.8.gz)

解决方案:把安装流程中 $gem sources -a http://ruby.taobao.org/   ---改为---->  $gem sources -a https://ruby.taobao.org/

错误2:

ERROR:  While executing gem ... (Errno::EPERM)

Operation not permitted - /usr/bin/pod

解决方案:苹果系统升级OS X EL Capitan后会出现的插件错误,将安装流程 4.安装CocoaPods 的 (1)sudo gem install cocoapods ——>改为sudo gem install -n /usr/local/bin cocoapods

错误3:

[!] Unable to satisfy the following requirements:  - `AVOSCloud (~> 3.1.6.3)` required by `Podfile` 

Specs satisfying the `AVOSCloud (~> 3.1.6.3)` dependency were found, but they required a higher minimum deployment target.


解决方案:安装流程:Podfile文件 中   platform:ios, ‘6.0’  后边的 6.0 是平台版本号 ,一定要加上

错误4: activesupport requires Ruby version >= 2.2.2. ruby运行环境版本过低 ,升级ruby版本即可

RVM:Ruby Version Manager,Ruby版本管理器,包括Ruby的版本管理和Gem库管理(gems)

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

测试是否安装正常

$ source ~/.bashrc 

$ source ~/.bash_profile

查看当前rvm版本

$ rvm -v

用RVM升级Ruby

查看当前ruby版本

ruby -v

列出可更新的版本列表

$ rvm list known

安装ruby 2.3.0

$ rvm install 2.3 

出现这样的错误


Error running '__rvm_make -j 1', showing last 15 lines of /Users/GDarkness/.rvm/log/1474100434_ruby-2.2.4/make.log

先安装xcode command line 即可解决

$ xcode-select --install

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值