在mac上安装cocoapods失败

时间:2014-07-19 14:23:58

标签: ruby gem rake cocoapods

我尝试根据说明http://cocoapods.org/在Mac上安装cocoapods,但收到如下错误:

$sudo gem install cocoapods

ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
bad response Service Unavailable: Back-end server is at capacity 503       (https://api.rubygems.org/api/v1/dependencies?gems=cocoapods)

但有时,错误信息不同。

$ sudo gem install cocoapods
Password:
Building native extensions.  This could take a while...
ERROR:  Error installing cocoapods:
ERROR: Failed to build gem native extension.

rake RUBYARCHDIR=/Users/tap4fun/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/extensions/x86_64-darwin-12/1.9.1/xcodeproj-0.17.0 RUBYLIBDIR=/Users/tap4fun/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/extensions/x86_64-darwin-12/1.9.1/xcodeproj-0.17.0/Users/tap4fun/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:298:in `to_specs': Could not find 'rake' (>= 0) among 20 total gem(s) (Gem::LoadError)
from /Users/tap4fun/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:309:in `to_spec'
from /Users/tap4fun/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_gem.rb:53:in `gem'
from /Users/tap4fun/.rvm/gems/ruby-1.9.3-p484/bin/rake:22:in `<main>'
from /Users/tap4fun/.rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:in `eval'
from /Users/tap4fun/.rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:in `<main>'

rake failed, exit code 1

Gem files will remain installed in /Users/tap4fun/.rvm/rubies/ruby-1.9.3- p484/lib/ruby/gems/1.9.1/gems/xcodeproj-0.17.0 for inspection.
Results logged to /Users/tap4fun/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/extensions/x86_64-darwin-12/1.9.1/xcodeproj-0.17.0/gem_make.out

ruby​​版本:1.9.3

rake版本:10.2.2

1 个答案:

答案 0 :(得分:9)

试试这个(为OSX 10.10工作)

  1. 打开Xcode 6
  2. 打开首选项
  3. 单击“位置”选项卡
  4. 将命令行工具版本更改为Xcode 6.0
  5. 卸载cocoapods

    $ sudo gem uninstall cocoapods

  6. 安装xcodeproj

    $ sudo gem install xcodeproj

  7. 安装cocoapods

    $ sudo gem install cocoapods

  8. 运行pod --version以验证