安装Cocoapods时候ERROR: While executing gem ... (Errno::EPERM)
OS X 10.11 安装Cocoapods 出现问题的解决方法
今天尝试用 Cocoapods安装个第三方库.. 输入pod install, 发现 command not find。 WTF!
估计是升级10.11后Cocoapods被干掉了。
我输入 sudo gem install cocoa pods 之后,出现如下问题:
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/xcodeproj
- 1
- 2
我估计是gem版本没有更新。执行sudo gem update –system,又出现了错误
ERROR: While executing gem ... (Errno::EPERM)
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,还是会出现上边的错误。
所以执行下边:
自定义GEM_HOME
$ mkdir -p $HOME/Software/ruby
$ export GEM_HOME=$HOME/Software/ruby
$ gem install cocoapods
[...]
1 gem installed
$ export PATH=$PATH:$HOME/Software/ruby/bin
$ pod --version
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的时候又花式出错
[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master`.
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.
- 1
- 2
我尝试按提示的方法
pod repo add master https://github.com/CocoaPods/Specs.git
- 1
然而还是有错..
[!] /usr/bin/git clone http://git.oschina.net/akuandev/Specs.git master
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
- 1
- 2
- 3
最后的解决方法:
sudo xcode-select -switch /Applications/Xcode-beta.app/Contents/Developers
- 1
后面的地址你可以打开Xcode显示包内容,找到那个文件夹拖到终端里面比较不容易错。
最后终于修成正果..
至于一开始输入 sudo gem install cocoapods 没反应需要修改为淘宝镜像的问题,请百度Cocoapods参阅其它文章..
安装Cocoapods时候ERROR: While executing gem ... (Errno::EPERM)的更多相关文章
- 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 可以尝试使用以下指令进 ...
- CocoaPod升级(以及ERROR: While executing gem ... (Errno::EPERM)解决办法)
最近pods 0.39.0 升级1.1.1 ,发现一个坑,好纠结,好歹最后解决了 过程如下: 本来我想直接执行: $ sudo gem install cocoapods // 安装cocoap ...
- cocoods 出现下面的问题:ERROR: While executing gem ... (Errno::EPERM)
今天安装cocoods 出现下面的问题:ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /us ...
- ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/pod
因为突然要用到cocospod,突然发现在使用pod install的时候出现 -bash: pod: command not found 我去-不知道为什么,然后我就想重新安装下cocospod,在 ...
- 安装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 ...
- 【CocoaPods】ERROR: While executing gem ... Gem::DependencyError
今天安装 CocoaPods 时遇到了这个问题. ERROR: While executing gem ... (Gem::DependencyError) Unable to resolve dep ...
- 终端中出现While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/pod错误的修改方法
把输入终端的sudo gem install cocoapods改为 sudo gem install -n /usr/local/bin/ cocoapods即可
- CocoaPods安装/更新报错While executing gem ... (OpenSSL::SSL::SSLError)解决方案
今天给新买的MacBook Pro更新CocoaPods,结果上来就报错,出师不利. HeinocdeMacBook-Pro:~ Heinoc$ sudo gem update --system Pa ...
- ERROR: While executing gem … (Gem::RemoteFetcher::FetchError)
原文地址:https://www.zfanw.com/blog/error-while-executing-gem-gem-remote-fetch-error.html 我对命令行下安装 gem 包 ...
随机推荐
- Oracle函数之LISTAGG
最近在学习的过程中,发现一个挺有意思的函数,它可实现对列值的拼接.下面我们来看看其具体用法. 用法: 对其作用,官方文档的解释如下: For a specified measure, LISTAGG ...
- 安装nginx
[yum安装nginx] yum clean all(这步不执行会出现no more mirrors to try错误) cd /etc/yum.repos.d/ vi nginx.repo 填写 [ ...
- 3.Struts2配置文件标签介绍
Struts2的很多核心功能都是由拦截器实现的. struts-default.xml中定义了这些拦截器与Result类型. 所以,不继承struts-default包,Struts2提供的很多核心功 ...
- 数据库设计(2/9):域,约束和默认值(Domains, Constraints and Defaults)
对于设计和创建数据库完全是个新手?没关系,Joe Celko, 世界上读者数量最多的SQL作者之一,会告诉你这些基础.和往常一样,即使是最专业的数据库老手,也会给他们带来惊喜.Joe是DMBS杂志是多 ...
- Moon.Orm 5.0 (MQL版) 欣赏另一种Orm的设计风格----大道至简
Moon.Orm 5.0(MQL版)使用指南(二) 一.使用sql及存储过程 1)使用List<Dictionary<))) 2)MQL 全面接触
- Python字典实现分析
背景介绍 最近使用Python开发项目为主,当使用到字典时感觉非常方便实用.那么好奇心就驱使我要搞清楚字典是怎么实现的.为了真正的搞清楚字典的实现就不得不使用C语言来实现一遍,为此我查了一些资料现在总 ...
- iOS的一些面试题分析总结(0)
虽然一些东西在实际工作中我们是很少用到的,但是面试确实会经常问到一些我们不常用的东西,所以说有时候看一看还是有必要的,一方面面试也是很重要的一件事,另一方面某些情况下也能帮我们查漏补缺. 一.NSNo ...
- 通过Canvas + JS 实现简易时钟实战
最近通过各种渠道学习了下html5中的canvas元素,为了练练手就随手写了一个简易的时钟.时钟本身不复杂,没有使用图片进行美化,下面就与大家分享一下具体的代码: 这是最终实现的效果: 部分的启发点来 ...
- SignalR入门篇
写在前面的废话 在写关于SignalR的学习笔记之前研究了几天的webSocket,毕竟这才是未来的技术趋势,虽然很早就听说过WebSocket,但是并没有在实际项目中遇到过,所以也就没有深入研究.通 ...
- Swift控制语句
前言 Swift提供了类似C语言的流程控制结构,包括可以多次执行任务的for和while循环.还有基于特定条件选择执行不同代码分支的if.guard和switch语句,还有控制流程跳转到其他代码的br ...