KTas
KTas

Reputation: 449

Unable to update cocoapods

Prior to trying to update my cocoapods I was on:

pod --version

0.22.3

Whenever I do a pod install I see the following message in my console:

CocoaPods 0.26.2 is available.

However every time I try to update Cocoapods it does not seem to work:

$ 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

Upvotes: 1

Views: 10652

Answers (2)

timgcarlson
timgcarlson

Reputation: 3146

I'm going to assume you're running Mavericks, in which case there were some changes made to Ruby. This gist is slightly outdated, but the steps you could try are...

Step 1) Make sure you have the most recent version of Xcode, as the command line tools are now packaged with it. (so as of 10/23/13, that'd be version 5.0.1).

Step 2) Run each of the following commands in Terminal...

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

Then try running sudo gem install cocoapods again.

Hope that helps.

--UPDATE--: I was having the same error message, while running Mavericks and Xcode 5.0. After updating Xcode to 5.0.1, I was able to update Cocoapods to 0.26.2. You shouldn't have to run the above commands.

Upvotes: 2

Chris Truman
Chris Truman

Reputation: 903

It looks like you are using Xcode from a volume and not from an installed copy on disk. It is trying to find xcode at the following path

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

Are you using xcode from a disk image? If not, you need to switch the active version of xcode using this command:

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)

Upvotes: 2

Related Questions