2013-10-23 34 views
1

此前試圖更新我的CocoaPods我是:無法更新的CocoaPods

pod --version 

0.22.3

每當我做一個吊艙安裝我看到在我的控制檯以下消息:

CocoaPods 0.26.2 is available. 

但是每一次我嘗試更新的CocoaPods時間似乎不工作:

$ 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/1.8/usr/bin/ruby extconf.rb 
checking for -std=c99 option to compiler... yes 
checking for CoreFoundation... yes 
checking for CoreFoundation/CoreFoundation.h... yes 
checking for CoreFoundation/CFStream.h... yes 
checking for CoreFoundation/CFPropertyList.h... yes 
checking for ruby/st.h... yes 
creating extconf.h 
creating Makefile 

make 
xcrun cc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin12.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -std=c99 -c xcodeproj_ext.c 
xcrun: Error: could not stat active Xcode path '/Volumes/Xcode/Xcode.app/Contents/Developer'. (No such file or directory) 
cc -arch i386 -arch x86_64 -pipe -bundle -undefined dynamic_lookup -o xcodeproj_ext.bundle xcodeproj_ext.o -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -ObjC -framework CoreFoundation -lruby -lpthread -ldl -lobjc 
clang: error: no such file or directory: 'xcodeproj_ext.o' 
make: *** [xcodeproj_ext.bundle] Error 1 


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/xcodeproj-0.13.1 for inspection. 
Results logged to /Library/Ruby/Gems/1.8/gems/xcodeproj-0.13.1/ext/xcodeproj/gem_make.out 



pod --version 
0.22.3 

回答

2

它看起來像是從卷中使用Xcode,而不是從磁盤上安裝的副本中使用。它試圖找到xcode在以下路徑

/Volumes/Xcode/Xcode.app/Contents/Developer'. (No such file or directory) 

您是否使用磁盤映像的xcode?如果沒有,您需要使用此命令切換的Xcode活動版本:

sudo xcode-select -switch /Applications/Xcode.app 

xcrun: Error: could not stat active Xcode path '/Volumes/Xcode/Xcode45-DP1.app/Contents/Developer'. (No such file or directory)

2

我會假設你正在運行的小牛,在這種情況下,有紅寶石做了一些改動。 This gist稍微過時了,但你可以嘗試的步驟是...

步驟1)確保你有最新版本的Xcode,因爲命令行工具現在與它打包在一起。 (截至2013年10月23日,版本5.0.1)。

步驟2)每運行在終端下面的命令......

sys_rb_usr=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr 
sdk_rb_usr=`xcode-select -p`/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr 
sudo cp -r $sdk_rb_usr/include $sys_rb_usr/include 

然後嘗試再次運行sudo gem install cocoapods

希望有所幫助。

--UPDATE -:我在運行Mavericks和Xcode 5.0時遇到了同樣的錯誤信息。在將Xcode更新爲5.0.1後,我能夠將Cocoapods更新爲0.26.2。您不應該運行上述命令。

+1

使用rvm做這個工作嗎? – achi