【问题标题】:install cocoapods failed on mac在 mac 上安装 cocoapods 失败
【发布时间】:2014-07-19 14:23:57
【问题描述】:

我尝试按照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

红宝石版本:1.9.3

rake 版本:10.2.2

【问题讨论】:

  • 你在 OSX Yosemite 上吗?
  • 是的,版本是10.9.3
  • 上述方法也适用于最新的 MacOS Beta 和 Xcode Beta,以防万一有人感兴趣...

标签: ruby gem rake cocoapods


【解决方案1】:

试试这个(使用 OSX 10.10 为我工作)

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

    $ sudo gem 卸载 cocoapods

  6. 安装 xcodeproj

    $ sudo gem install xcodeproj

  7. 安装 cocoapods

    $ sudo gem install cocoapods

运行pod --version进行验证

【讨论】:

  • 它不起作用,错误:安装 xcodeproj 时出错:错误:无法构建 gem 原生扩展。/Users/tap4fun/.rvm/rubies/ruby-1.9.3-p484/lib/ruby /site_ruby/1.9.1/rubygems/dependency.rb:298:in `to_specs':在总共 20 个 gem 中找不到 'rake' (>= 0) (Gem::LoadError)
  • 好吧,你遇到了和我一样的问题...所以首先在终端输入: ruby​​ -e "$(curl -fsSL raw.github.com/Homebrew/homebrew/go/install)"
  • 那我该怎么办?
  • $ brew install postgresql
  • 我在安装 postgresql 时遇到错误,错误:Homebrew 不知道您的 Xcode (6.0) 版本附带了哪些编译器版本。请brew update,如果这没有帮助,请在brew --config 的输出中提出问题:github.com/Homebrew/homebrew/issues 请注意,我们只跟踪稳定、已发布的 Xcode 版本。
猜你喜欢
  • 2021-04-03
  • 2014-11-12
  • 2020-09-16
  • 2014-09-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-07-11
  • 2019-05-06
相关资源
最近更新 更多