环境:OSX EI 10.11.1

昨天切换gem源后,招待pod安装没有任何问题,也可以正常用
$ gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/
$ sudo gem install cocoapods 今天再使用的时候,在一个项目下执行pod install时半天死活没反应,无奈就ctrl+c了强制退出了。然后再执行的时候就出现错误:

Library/Ruby/Site/2.0.0/rubygems/dependency.rb:318:in `to_specs': Could not find 'cocoapods' (>= 0) among 33 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/Users/xianlong/.gem/ruby/2.0.0:/Library/Ruby/Gems/2.0.0:/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0', execute `gem env` for more information
from /Library/Ruby/Site/2.0.0/rubygems/dependency.rb:327:in `to_spec'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_gem.rb:64:in `gem'
from /usr/local/bin/pod:22:in `<main>'

分析可能是因为强制退出程序导致的配置被损坏。于是把pod卸载,重新安装后就ok了。

卸载Pod:

step1:

which pod: 查看pod命令所在路径,比如为/usr/local/bin/pod,然后执行 rm -rf /usr/local/bin/pod 将pod命令移除

step2:

执行gem list | grep cocoapods  查看所有与cocoapods相关的已安装的组件,然后挨个卸载

我这里的执行结果是:

cocoapods-core (0.39.0)

cocoapods-downloader (0.9.3)

cocoapods-plugins (0.4.2)

cocoapods-search (0.1.0)

cocoapods-stats (0.6.2)

cocoapods-trunk (0.6.4)

cocoapods-try (0.5.1)

然后我就挨个执行:

gem uninstall cocoapods-core

gem uninstall cocoapods-downloader

gem uninstall cocoapods-plugins

gem uninstall cocoapods-search

gem uninstall cocoapods-stats

gem uninstall cocoapods-trunk

gem uninstall cocoapods-try

step3: 重新安装pod

执行sudo gem install cocoapods, 提示出错:While executing gem ... (Errno::EPERM)     Operation not permitted - /usr/bin/pod

在命令中指定安装到/usr/bin/pods下即可正常安装成功:

sudo gem install -n /usr/local/bin  cocoapods

安装成功,

step4: 查看新安装的pod版本:

pod --version

0.39.0

 

安装Pod时提示ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/pod的更多相关文章

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

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

  2. 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 可以尝试使用以下指令进 ...

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

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

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

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

  5. 安装Cocoapods时候ERROR: While executing gem ... (Errno::EPERM)

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

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

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

  7. Operation not permitted - /usr/bin/pod

    问题描述:执行sudo gem install cocoapods, 提示出错:While executing gem ... (Errno::EPERM)     Operation not per ...

  8. ubuntu安装nginx时提示error: the HTTP rewrite module requires the PCRE library

    ubuntu安装nginx时提示error: the HTTP rewrite module requires the PCRE library 须要安装pcre包. sudo apt-get upd ...

  9. 安装cocoa pods时出现Operation not permitted - /usr/bin/xcodeproj的问题

    安装cocoa pods时, 在命令行中输入: 安装:sudo gem install cocoapods报Operation not permitted - /usr/bin/xcodeproj这个 ...

随机推荐

  1. ARM9代码分析启动MAIN.C

    #define GLOBAL_CLK 1 #include <stdlib.h> #include <string.h> #include “def.h” #include “ ...

  2. How to run a (Tomcat)Java application server on a Azure virtual machine

    http://www.windowsazure.com/en-us/documentation/articles/virtual-machines-java-run-tomcat-applicatio ...

  3. CSS3:transform translate transition 这些都是什么?

    transform:一个属性名称,即CSS3 2D转换 属性. translate:一个属性函数,用法是translate(dx,dy) div { transform: translate(50px ...

  4. 自定义宏把Word打造成全快捷键编辑器

    自定义快捷键 折叠所有标题 Word选项—自定义功能区—自定义键盘—不在功能区内的命令—ColllapseAllHeadings 展开所有标题 Word选项—自定义功能区—自定义键盘—不在功能区内的命 ...

  5. 161209、简要分析ZooKeeper基本原理及安装部署

    一.ZooKeeper 基本概念 1.ZooKeeper 是什么? Zookeeper官网地址: http://zookeeper.apache.org/ Zookeeper官网文档地址:http:/ ...

  6. SQL标签

    SQL标签库提供了与关系型数据库进行交互的标签. 引入语法:<%@ taglib prefix="sql" uri="http://java.sun.com/jsp ...

  7. Web Server 配置及上传文件

    第一种方案:从github上面克隆到服务器 1.git上传文件 ( git bash ) ①切换至所要上传的文件夹 cd 文件夹homepage ②告诉系统当前文件夹要进行git管理 git init ...

  8. js与jsp

    jsp :j2ee 中的一样模版技术,运行于服务器端javascript :一种运行于客户端的脚本语言,动态性.JavaScript是一种采用事件驱动的脚本语言,它不需要经过Web服务器就可以对用户的 ...

  9. IntelliJ IDEA 14和Maven创建java web项目

    安装Maven 下载安装 去maven官网下载最新版. 解压到安装目录. 配置 右键桌面的计算机图标,属性–>高级系统设置–>环境变量,添加M2_HOME的环境变量,然后将该变量加入的PA ...

  10. 使用GIt向github上传代码

    github是一个基于git的代码托管平台,付费用户可以建私人仓库,我们一般的免费用户只能使用公共仓库,也就是代码要公开.这对于一般人来说公共仓库就已经足够了. 1.注册账户以及创建仓库     要想 ...