无法在优胜美地DP 7上安装Cocoapods [英] Unable to install Cocoapods on Yosemite DP 7

查看:175
本文介绍了无法在优胜美地DP 7上安装Cocoapods的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在安装在单独分区上的Yosemite DP 7上安装Cocoapods.我已经尝试按照 Cocoapods与Xcode 6和10.10 Yosemite 并解决问题( https://github.com/CocoaPods/CocoaPods/issues/2219 )由于在Stack Overflow链接上提出了相同的解决方案而关闭.

I am having trouble installing Cocoapods on Yosemite DP 7 installed on a separate partition. I already attempted following the instructions found on Cocoapods with Xcode 6 and 10.10 Yosemite and in the issue(https://github.com/CocoaPods/CocoaPods/issues/2219) closed due to the same solution proposed on the Stack Overflow link.

我继续出现以下错误:

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

我怀疑这可能与我在另一个分区上拥有优胜美地这一事实有关,但否则我一无所知.

I am suspecting that this may have to do with the fact that I have Yosemite on a separate partition, but otherwise I am clueless.

推荐答案

我遇到了同样的问题.在按照与其他所有人相同的步骤拉了很多头发之后,以下方法起作用了.

I ran into the same issue. After much hair pulling following the same steps as everyone else, the following worked.

  1. $ xcode-select --install(确认已安装命令行工具)

  1. $ xcode-select --install (to confirm command line tools are installed)

已安装的nvm稳定版(和自制软件):$ \ curl -sSL https://get.rvm.io | bash -s稳定

Installed nvm stable (and homebrew): $ \curl -sSL https://get.rvm.io | bash -s stable

关闭/重新打开终端

已安装的ruby 2.1.2:$ rvm install 2.1

Installed ruby 2.1.2: $ rvm install 2.1

切换到它:$ rvm use 2.1

Switch to it: $ rvm use 2.1

卸载/重新安装xcodeproj和cocoapods

Uninstall/reinstall xcodeproj and cocoapods

这篇关于无法在优胜美地DP 7上安装Cocoapods的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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