码迷,mamicode.com
首页 > 其他好文 > 详细

mark~ 10.11 cocoapods安装

时间:2015-11-09 12:52:40      阅读:254      评论:0      收藏:0      [点我收藏+]

标签:

执行sudo gem install cocoapods出现错误:

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.0

执行完这句如果报告以下错误:
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: cocoapods

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

如果gem太老,可以尝试用如下命令升级gem
$ sudo gem update --system
升级成功后会提示: RubyGems system software updated

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



mark~ 10.11 cocoapods安装

标签:

原文地址:http://my.oschina.net/u/868062/blog/527971

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!