在 mac 上安装 cocoapods 失败 [英] install cocoapods failed on mac

查看:34
本文介绍了在 mac 上安装 cocoapods 失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试按照 http://cocoapods.org/ 的说明在 mac 上安装 cocoapods,但得到了错误如下:

I tried to install cocoapods on mac according to the instructions http://cocoapods.org/ , but got the error as below:

$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)

但有时,错误信息会有所不同.

but sometimes, the error message is different。

$ 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

红宝石版本:1.9.3

ruby version: 1.9.3

rake 版本:10.2.2

rake version: 10.2.2

推荐答案

试试这个(在 OSX 10.10 上为我工作)

Try this (Worked for me with OSX 10.10)

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

  1. Open Xcode 6
  2. Open Preferences
  3. Click the Locations tab
  4. Change the Command Line Tools version to Xcode 6.0
  5. Uninstall cocoapods

$ sudo gem 卸载 cocoapods

$ sudo gem uninstall cocoapods

安装 xcodeproj

Install xcodeproj

$ sudo gem install xcodeproj

$ sudo gem install xcodeproj

安装 cocoapods

Install cocoapods

$ sudo gem install cocoapods

$ sudo gem install cocoapods

运行pod --version进行验证

这篇关于在 mac 上安装 cocoapods 失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆