无法在Yosemite DP上安装Cocoapods 7
我在安装在单独分区上的Yosemite DP 7上安装Cocoapods时遇到问题。我已尝试遵循Cocoapods with Xcode 6 and 10.10 Yosemite上发现的指示以及由于堆栈溢出链路上提出的相同解决方案而关闭的问题(https://github.com/CocoaPods/CocoaPods/issues/2219)中的指示。无法在Yosemite DP上安装Cocoapods 7
我不断收到以下错误:
Rasmuss-MacBook-Pro:~ rasmusth$ sudo gem install cocoapods
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
"/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby" -rubygems /Library/Ruby/Gems/2.0.0/gems/rake-0.9.6/bin/rake RUBYARCHDIR=/Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/ext RUBYLIBDIR=/Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/ext
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for -std=c99 option to compiler... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:549:in `block in try_compile'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:502:in `with_werror'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:549:in `try_compile'
from extconf.rb:24:in `block in <main>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:895:in `block in checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:894:in `checking_for'
from extconf.rb:23:in `<main>'
rake aborted!
Command failed with status (1): [/System/Library/Frameworks/Ruby.framework/...]
/Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/ext/xcodeproj/Rakefile:37:in `block in <top (required)>'
Tasks: TOP => default => ext
(See full trace by running task with --trace)
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/ext/xcodeproj/gem_make.out
我怀疑这可能与事实,我有优山美地在一个单独的分区做,但除此之外,我无言以对。
我遇到了同样的问题。经过与其他人相同的步骤拉了很多头发后,下面的工作。
$的Xcode选--install(确认命令行工具安装)
安装NVM稳定(并自制):$ \卷曲-ssl https://get.rvm.io |庆典-s稳定
关闭/重新打开终端
安装了Ruby 2.1.2:$ RVM安装2.1
切换到它:$ RVM使用2.1
卸载/重装xcodeproj和cocoapods
谢谢!非常有帮助! – ggould75 2014-09-05 12:11:15
事实上,这是唯一的解决方案,我与优胜美地DP7和Xcode6通用汽车,谢谢。 – 2014-09-12 08:04:38
Xcode 6.0 GM缺少10.10 SDK,因此gem xcodeproj
无法编译,其中有一些需要10.10 SDK的C代码。 这将在未来得到解决。 现在你可以解决它像这样:
- 终端:sudo的创业板卸载的CocoaPods xcodeproj
- 下载的Xcode 6.1(现在Beta 2的是目前的一个)
- 开始就进入设置 - >位置 - >命令行工具 - >切换到的Xcode 6.1测试版
- 终端:sudo的创业板安装的CocoaPods
- 更改您的命令行工具回到GM(如果你想/需要)
欲了解更多信息,请参阅:https://github.com/CocoaPods/CocoaPods/issues/2432
我遇到类似的问题与你,我的发展环境有问题。您可以从[这里]获取一些信息(http://stackoverflow.com/questions/24841392/install-cocoapods-failed-on-mac) – pangpang 2014-09-04 11:38:09
我的问题描述的一部分指出我尝试了确切的解决方案描述。 – 2014-09-04 12:49:45
我在一个分区上有优胜美地,遇到同样的问题。 – DeepFriedTwinkie 2014-09-04 16:14:39