ruby – 在mac上安装cocoapods失败了

前端之家收集整理的这篇文章主要介绍了ruby – 在mac上安装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

红宝石版本:1.9.3

rake版本:10.2.2

解决方法

试试这个(为OSX 10.10工作)

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

$sudo gem uninstall cocoapods
>安装xcodeproj

$sudo gem install xcodeproj
>安装cocoapods

$sudo gem install cocoapods

运行pod –version来验证

原文链接:https://www.f2er.com/ruby/274244.html

猜你在找的Ruby相关文章