关于ERROR: While executing gem ... (Errno::EPERM)Operation not permitted - /usr/bin/xcodeproj的问题

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

第一种方法(我是用此方法解决的):终端输入

 mkdir -p $HOME/Software/ruby

 export GEM_HOME=$HOME/Software/ruby

 gem install cocoapods

 export PATH=$PATH:$HOME/Sofware/ruby/bin

 pod --version
一行一行的输入


第二种解决办法如下:

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

就完美的解决了,代替原来的:

sudo gem install cocoapods


附录:安装步骤

1、打开mac的命令窗口

输入:

gem sources --remove https://rubygems.org/ 
gem sources -a https://ruby.taobao.org/ 
gem sources -l  

2、安装cocopods

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



或者一起输入到终端

 mkdir -p $HOME/Software/ruby

 export GEM_HOME=$HOME/Software/ruby

 gem install cocoapods

 export PATH=$PATH:$HOME/Sofware/ruby/bin

 pod --version


你可能感兴趣的:(ios)