pod install 出错

4 篇文章 0 订阅

pod install 出错

一、问题描述

in `to_specs’: Could not find ‘cocoapods’

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in to_specs': Could not find 'cocoapods' (>= 0) among 13 total gem(s) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in
to_spec’
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in gem'
from /usr/local/bin/pod:22:in

二、首先确认下Ruby的版本

MAC自带的Ruby版本一般比较低(记得是2.0.0,查看版本ruby -v),先升级一下,

1.没有安装homebrew的话先安装一下

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

2.通过 brew 安装 Ruby 最新版本

brew update
brew install ruby

三、重新安装一下cocoapods

不要使用 sudo gem install cocoapods ,这样的话可能会有一些问题 , 现在解决一下现在的问题 。

1. Uninstall Cocoapods:
sudo gem uninstall cocoapods
2.Install cocoapods without sudo:
 gem install cocoapods -V --no-ri --no-rdoc
 # V: Verbose; no-ri,no-rdoc: Do not install documentation
3.Set up Cocoapods:
pod setup

四、Should work now

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值