2014-09-12 1 views
7

CocoaPods을 요세미티에 설치하는 데 문제가 있습니다. 다음 명령으로 보석 설치를 설정합니다.오류 : Yosemite에서 보석 기본 확장 프로그램을 만들지 못했습니다.

이것은 명령의 응답입니다.

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 

누군가 나를 도와 줄 수 있습니까?

답변

12

마지막으로 문제가 무엇인지 알아 냈습니다.

먼저 Xcode 명령 도구를 설치해야합니다.

xcode-select --install 

둘째는이를 레일에 루비 잘 설정되어 있는지 확인해야한다.

엑스 코드 (6)의 환경에서 해당 연결 엑스 코드 명령 도구 후

그런 다음 명령 sudo gem install cocoapods를 사용할 수있다.

3

특정 오류가있는 것은 확실하지 않지만, 요즘으로 업데이트 한 후 Ruby를 다시 설치해야 코코아 포드를 설치할 수 있습니다.

업데이트 후 Ruby 구성이 손상된 것처럼 보입니다.

또한 Homebrew을 사용하여 Ruby 버전 및 설치를 관리 할 수 ​​있습니다 (기본적으로 Ruby 만 해당되는 것은 아닙니다).

관련 문제