本文介绍了在mac上安装cocoapods失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图按照的说明在mac上安装cocoapods,但是获得了错误如下:
$ sudo gem install cocoapods
错误:执行gem ...( Gem :: RemoteFetcher :: FetchError)
错误响应服务不可用:后端服务器的容量为503(https://api.rubygems.org/api/v1/dependencies?gems=cocoapods)
但有时,错误信息不同。
$ sudo gem install cocoapods
密码:
构建原生扩展。这可能需要一段时间...
错误:安装cocoapods时出错:
错误:无法构建gem本机扩展。
$ b $ 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':找不到'rake' (> = 0)在来自/Users/tap4fun/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9的20个宝石(Gem :: LoadError)
之中。 1 / rubygems / dependency.rb:309:位于/Users/tap4fun/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext的`to_spec'
中/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:在< main>'
rake失败,退出代码1
Gem文件将保持安装在/Users/tap4fun/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/gems/xcodeproj-0.17。 0进行检查。
记录到/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 version:10.2.2
解决方案
试试这个(为OSX 10.10工作)
- 打开Xcode 6
- 打开首选项
- 将命令行工具版本更改为Xcode 6.0
-
卸载cocoapods
$ sudo gem uninstall cocoapods
安装xcodeproj - Open Xcode 6
- Open Preferences
- Click the Locations tab
- Change the Command Line Tools version to Xcode 6.0
Uninstall cocoapods
$ sudo gem uninstall cocoapods
Install xcodeproj
$ sudo gem install xcodeproj
Install cocoapods
$ sudo gem install cocoapods
$ b $ sudo gem install xcodeproj 安装cocoapods
$ sudo gem install cocoapods
ol>
运行 pod --version
来验证
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
ruby version: 1.9.3
rake version: 10.2.2
解决方案
Try this (Worked for me with OSX 10.10)
Run pod --version
to verify
这篇关于在mac上安装cocoapods失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!