OS X 10.11 安装Cocoapods 出现问题的解决方法 
今天尝试用 Cocoapods安装个第三方库.. 输入pod install, 发现 command not find。 WTF!

估计是升级10.11后Cocoapods被干掉了。

我输入 sudo gem install cocoa pods 之后,出现如下问题:

  1. ERROR: While executing gem ... (Errno::EPERM)
  2. Operation not permitted - /usr/bin/xcodeproj
  • 1
  • 2

我估计是gem版本没有更新。执行sudo gem update –system,又出现了错误

  1. ERROR: While executing gem ... (Errno::EPERM)
  2. Operation not permitted - /usr/bin/update_rubygems
  • 1
  • 2

Stackoverflow上找到了解决方法:

因为知道gem版本过老的话也是不能成功下载cocoapods的,但是我现在又不能用sudo gem update –system来更新。后来我就直接去rubygems官网下载了最新的源码进行了安装。现在执行gem -v显示版本是2.4.8。 
可以看我另外一篇文章,手动安装gem

可是问题又来了,这个时候去执行sudo gem install cocoapods,还是会出现上边的错误。 
所以执行下边:

  1. 自定义GEM_HOME
  2. $ mkdir -p $HOME/Software/ruby
  3. $ export GEM_HOME=$HOME/Software/ruby
  4. $ gem install cocoapods
  5. [...]
  6. 1 gem installed
  7. $ export PATH=$PATH:$HOME/Software/ruby/bin
  8. $ pod --version
  9. 0.38.2
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

GEM_PATH与GEM_HOME 的区别:

1.GEM_PATH provides the locations (there may be several) where gems can be found. 
2.GEM_HOME is where gems will be installed (by default).(Therefore GEM_PATH should include GEM_HOME).

但是之后我pod install的时候又花式出错

  1. [!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master`.
  2. You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.
  • 1
  • 2

我尝试按提示的方法

  1. pod repo add master https://github.com/CocoaPods/Specs.git
  • 1

然而还是有错..

  1. [!] /usr/bin/git clone http://git.oschina.net/akuandev/Specs.git master
  2. xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  • 1
  • 2
  • 3

最后的解决方法:

  1. sudo xcode-select -switch /Applications/Xcode-beta.app/Contents/Developers
  • 1

后面的地址你可以打开Xcode显示包内容,找到那个文件夹拖到终端里面比较不容易错。

最后终于修成正果..

至于一开始输入 sudo gem install cocoapods 没反应需要修改为淘宝镜像的问题,请百度Cocoapods参阅其它文章..

安装Cocoapods时候ERROR: While executing gem ... (Errno::EPERM)的更多相关文章

  1. Jekyll 安装权限问题 ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/jekyll

    OS X El Capitan 新特性(System Integrity Protection or SIP)中加强了权限,但是可以对这里进行操作 /usr/local/bin 可以尝试使用以下指令进 ...

  2. CocoaPod升级(以及ERROR: While executing gem ... (Errno::EPERM)解决办法)

    最近pods  0.39.0 升级1.1.1  ,发现一个坑,好纠结,好歹最后解决了 过程如下: 本来我想直接执行: $ sudo gem install cocoapods  // 安装cocoap ...

  3. cocoods 出现下面的问题:ERROR: While executing gem ... (Errno::EPERM)

    今天安装cocoods 出现下面的问题:ERROR:  While executing gem ... (Errno::EPERM)     Operation not permitted - /us ...

  4. ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/pod

    因为突然要用到cocospod,突然发现在使用pod install的时候出现 -bash: pod: command not found 我去-不知道为什么,然后我就想重新安装下cocospod,在 ...

  5. 安装Pod时提示ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/pod

    环境:OSX EI 10.11.1 昨天切换gem源后,招待pod安装没有任何问题,也可以正常用$ gem sources --add https://ruby.taobao.org/ --remov ...

  6. 【CocoaPods】ERROR: While executing gem ... Gem::DependencyError

    今天安装 CocoaPods 时遇到了这个问题. ERROR: While executing gem ... (Gem::DependencyError) Unable to resolve dep ...

  7. 终端中出现While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/pod错误的修改方法

    把输入终端的sudo gem install cocoapods改为 sudo gem install -n /usr/local/bin/ cocoapods即可

  8. CocoaPods安装/更新报错While executing gem ... (OpenSSL::SSL::SSLError)解决方案

    今天给新买的MacBook Pro更新CocoaPods,结果上来就报错,出师不利. HeinocdeMacBook-Pro:~ Heinoc$ sudo gem update --system Pa ...

  9. ERROR: While executing gem … (Gem::RemoteFetcher::FetchError)

    原文地址:https://www.zfanw.com/blog/error-while-executing-gem-gem-remote-fetch-error.html 我对命令行下安装 gem 包 ...

随机推荐

  1. 深入探讨:标签(Tag)的各种设计方案

    首先,标签(Tag)是什么? 我的理解:用来具体区分某一类内容的标识,和标签类似的一个概念是分类(Category),有一个示例可以很好的区分它们两个,比如人类分为:白种人.黄种人和黑种人(可以看作分 ...

  2. AWS CLI使用s3

    aws CLI是什么东西,暂且先不去了解,目前的需求是s3. 我在Jenkins上创建一个bucket,然后申请access_key,然后就可以使用s3来存储数据了.也就是说,s3就是一个网盘. 1. ...

  3. co.js - 让异步代码同步化

    近期在全力开发个人网站,并且又沉淀了一些前后端的技术.近期会频繁更新. 这篇文章首发于我的个人网站:听说 - https://tasaid.com/,建议在我的个人网站阅读,拥有更好的阅读体验. 这篇 ...

  4. 使用签名来保证ASP.NET MVC OR WEBAPI的接口安全

    当我们开发一款App的时候,App需要跟后台服务进行通信获取或者提交数据.如果我们没有完善的安全机制则很容易被别用心的人伪造请求而篡改数据. 所以我们需要使用某种安全机制来保证请求的合法.现在最常用的 ...

  5. [C#] .NET4.0中使用4.5中的 async/await 功能实现异

    好东西需要分享 原文出自:http://www.itnose.net/detail/6091186.html 在.NET Framework 4.5中添加了新的异步操作库,但是在.NET Framew ...

  6. Integer 与int 的区别

    int 是java 提供的8 种原始数据类型之一.Java 为每个原始类型提供了封装类,Integer 是java 为int 提供的封装类.int 的默认值为0,而Integer 的默认值为null, ...

  7. PHP工作笔记:数组转字符串与字符串转数组

    一个数组要入库,发现不可以,特定用函数转为字符串入库 $data = array( 'http://img4.bitautoimg.com/autoalbum/files/20110420/734/2 ...

  8. python基础之运算符

    算术运算符 运算符 描述 实例 + 加 - 两个对象相加 a + b 输出结果 31 - 减 - 得到负数或是一个数减去另一个数 a - b 输出结果 -11 * 乘 - 两个数相乘或是返回一个被重复 ...

  9. python之协程与IO操作

    协程 协程,又称微线程,纤程.英文名Coroutine. 协程的概念很早就提出来了,但直到最近几年才在某些语言(如Lua)中得到广泛应用. 子程序,或者称为函数,在所有语言中都是层级调用,比如A调用B ...

  10. Lind.DDD.IoC依赖注入与面向方面的实现

    回到目录 IoC是解耦的灵魂,很难想像一个框架中没有IoC会变成什么样子,Lind.DDD里的IoC是通过Unity实现的,由依赖注入(unity)和方法拦截组成(Interception),依赖注入 ...