mark~ 10.11 cocoapods安装

执行sudo gem install cocoapods出现错误:xcode

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

自定义GEM_HOME
$ mkdir -p $HOME/Software/ruby
$ export GEM_HOME=$HOME/Software/ruby
$ gem install cocoapods
[...]
1 gem installed
$ export PATH=$PATH:$HOME/Sofware/ruby/bin
$ pod --version
0.39.0ruby

执行完这句若是报告如下错误:
ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT: Operation timed out - connect(2) (https://rubygems.org/latest_specs.4.8.gz)
ERROR: Possible alternatives: cocoapodsspa

这是由于ruby的软件源rubygems.org由于使用亚马逊的云服务,被我天朝屏蔽了,须要更新一下ruby的源,过程以下:
$ gem sources -l (查看当前ruby的源)
$ gem sources --remove https://rubygems.org/
$ gem sources -a https://ruby.taobao.org/
$ gem sources -lcode

若是gem太老,能够尝试用以下命令升级gem
$ sudo gem update --system
升级成功后会提示: RubyGems system software updatedorm

10.11 cocoapods安装 sudo gem install -n /usr/local/bin cocoapods
coffeescript

相关文章
相关标签/搜索