安装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/ --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

 
时间: 2024-10-01 03:57:06

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

cocoapods 安装报错 ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/xcodeproj

cocoapods 安装报错 ERROR:  While executing gem ... (Errno::EPERM)     Operation not permitted - /usr/bin/xcodeproj 执行下面语句安装即可: sudo gem install -n /usr/local/bin cocoapods

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 可以尝试使用以下指令进行jekyll的安装(亲测可行,安装完毕后terminal中输入jekyll即可看到是否生效): sudo gem install -n /usr/local/bin/ jekyll 这条指令告诉gem,把jekyll安装到不受SIP保护的文件夹,而不是安装到默认/Library/Ruby/Gems

安装tesserocr时提示error: Microsoft Visual C++ 14.0 is required

pip install tesserocr pillow时,提示: 按照给的提示,进到微软官网,啥都没有,pip的安装报错提示是时候更新一波了~ 在网上找Microsoft Visual C++的资料,十分稀少,只能采用wheel安装编译后的压缩包.whl文件本质上是一个压缩包,里面包含了py文件以及经过编译的pyd文件,可以在不具备编译环境的情况下,进行安装.pip默认也是先下载wheel安装,没有的话在对源码进行编译(包含了C++的源码都需要编译),而需要的Microsoft Visual

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

需要安装pcre包. sudo apt-get update sudo apt-get install libpcre3 libpcre3-dev 你可能还需要安装 sudo apt-get install openssl libssl-dev

ERROR: While executing gem ... (Encoding::UndefinedConversionError) U+7CFB to IBM437 in conversion from UTF-16LE to UTF-8 to IBM437,当你执行gem 命令时,提示如上信息解决方案如下。

when you  use  gem install package ,the result:ERROR: While executing gem ... (Encoding::UndefinedConversionError) U+7CFB to IBM437 in conversion from UTF-16LE to UTF-8 to IBM437 解决方法: 去本地路径下修改编码,这么提示是因为编码不一致导致的. 修改registry 文件中的编码: 修改后就没有问题了.

ERROR: While executing gem ... (Gem::Exception) Unable to require openssl...............................

今天在centOS7上安装ruby3.2.0时,gem install redis 出现ERROR: While executing gem ... (Gem::Exception) Unable to require openssl.................... 试了网上很多的方法还是出现了这个问题. 最后索性删除了本来的ruby,重新安装后就可以了. 正确的安装步骤是先安装开发工具和依赖包 先安装开发工具 1.命令:yum groupinstall "Development too

[原]linux安装软件时提示找不到镜像的问题:Couldn&#39;t resolve host &#39;mirrorlist.centos.org&#39;

问题:[[email protected] ~]# yum -y install gcc-*Loaded plugins: fastestmirror, prestoCould not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.cent

genymotion2.8.1安装apk时提示ARM……x86……异常处理

这两天接触android studio,跟着教程,接触到genymotion模拟器,版本2.8.1-- 本人使用的模拟器配置为:google nuex4,android sdk4.4.4,安装微信时提示如下: an error occured while deploying the file. this probably means that the app contians ARM native code and you Genymotion device cannot run ARM ins

mysql数据库导入sql文件时提示“Error Code: 1153 - Got a packet bigger than &#39;max_allowed_packet&#39; bytes”解决办法

向mysql数据库中导入sql文件时,如果文件过大(几百M),会提示"Error Code: 1153 - Got a packet bigger than 'max_allowed_packet' bytes" 1.查看目前数据库配置 show VARIABLES like '%max_allowed_packet%'; 显示如下结果 +--------------------+---------+ | Variable_name      | Value   | +--------