Cocoapods with Xcode 6 and 10.10 Yosemite

XcodeCocoapodsOsx YosemiteOsx Yosemite-Beta

Xcode Problem Overview


After initially upgrading to 10.10 and XCode6-Beta, I tried to run 'pod update' and I received this error:

cannot load such file -- xcodeproj/prebuilt/universal.x86_64-darwin14-2.0.0/xcodeproj_ext (LoadError)

I tried to update Cocoapods using 'sudo gem install cocoapods', but received another error:

Fetching: xcodeproj-0.17.0.gem (100%)
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-10.1.1/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.

Has anyone else been able to successfully use Cocoapods with Xcode 6 on 10.10 Yosemite?

Xcode Solutions


Solution 1 - Xcode

  1. Open Xcode 6
  2. Open Preferences
  3. Click the Locations tab
  4. Change the Command Line Tools version to Xcode 6.0
  5. Uninstall cocoapods
    $ sudo gem uninstall cocoapods
  6. Uninstall xcodeproj $ sudo gem uninstall xcodeproj
  7. Install xcodeproj
    $ sudo gem install xcodeproj
  8. Install cocoapods
    $ sudo gem install cocoapods
  9. Run pod --version to verify that it worked

Solution 2 - Xcode

// Running Xcode6-Beta7 on 10.10 (14A343f)

I have tried all of the above and didn't have any luck. Here's what worked for me:

I installed the latest version of Ruby via Homebrew (took a few minutes)

brew install ruby

then installed Cocoapods as usual

sudo gem install cocoapods

and it worked a treat!

Solution 3 - Xcode

Follow these steps:

1- Open Xcode 6, open Preferences, click the Locations tab, change the Command Line Tools version to Xcode 6.0

2- sudo gem uninstall cocoapods

3- sudo gem uninstall xcodeproj

4- ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

5- curl -L https://get.rvm.io | bash -s stable --ruby

6- source /Users/your_user_name/.rvm/scripts/rvm

7- rvm reload

8- rvm rubygems latest --force

9- gem install xcodeproj

10- gem install cocoapods

8- pod --version

Solution 4 - Xcode

In addition to uninstalling cocoapods and installing xcodeproj gems. I also had to tell rvm to use the system ruby. Strange because my rvm install was 2.0.0 as was the system version after switching to use 6.0.0 Command Line Tools

rvm use system    
sudo gem uninstall cocoapods
sudo gem install xcodeproj
sudo gem install cocoapods
pod install

Solution 5 - Xcode

Okay, looks like it's been reported and has a workaround: https://github.com/CocoaPods/CocoaPods/issues/2219

The following worked for me:

sudo gem uninstall cocoapods
sudo gem install xcodeproj
sudo gem install cocoapods
pod update

Solution 6 - Xcode

Try it:

/usr/bin/login -f your_mac_username

cd "to your project"

pod install

Done.

Solution 7 - Xcode

Xcode 6.0 GM is missing the 10.10 SDK and therefore the gem xcodeproj can't be compiled which has some C code in it which needs the 10.10 SDK. This is going to be fixed in the future. For now you can work around it like this (no need for rvm or anything else):

  • Terminal: sudo gem uninstall cocoapods xcodeproj
  • Download Xcode 6.1 (right now Beta 2 is the current one)
  • Start it go to Settings -> Location -> Command Line Tools -> Change to Xcode 6.1 Beta
  • Terminal: sudo gem install cocoapods
  • Change your Command Line tools back to GM (if you want/need)

For more information see: https://github.com/CocoaPods/CocoaPods/issues/2432

Solution 8 - Xcode

We released CocoaPods 0.34 which no longer has any C based extensions and will install without even installing Xcode, thus should be able to work around this tough setup that Apple gave us all.

Solution 9 - Xcode

i found this solution in this https://github.com/CocoaPods/CocoaPods/issues/2432">link</a>

$sudo ln -s /Applications/Xcode6-Beta7.app /Applications/Xcode.app $sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.Internal.sdk $ sudo gem install cocoapods

once the installation done, you can delete the links like so :

$ rm /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.Internal.sdk $ rm /Applications/Xcode.app

Solution 10 - Xcode

I have figured out that simply deleting ~/.rvm folder resolves whatever problems arise from version, ACL, and configuration conflicts. All your gems will have to be reinstalled but this is the simplest solution I've found. You can continue using Xcode 5 (no switch required). So simply run

> sudo rm -rf ~/.rvm

in shell.

Solution 11 - Xcode

I tried all the steps in Kyle Robson answer. The update to Yosemite Dev Preview 8 resolved the problem for me.

Solution 12 - Xcode

I solved this problem by re-downloading the latest version of the Command Line Tools for 10.10

Solution 13 - Xcode

Try this:

sudo gem uninstall cocoapods
sudo gem install cocoapods
$ pod repo remove master
$ pod setup
$ pod install

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAdam FoxView Question on Stackoverflow
Solution 1 - XcodeHighFlyingFantasyView Answer on Stackoverflow
Solution 2 - XcodejohnyorkeView Answer on Stackoverflow
Solution 3 - XcodeF79View Answer on Stackoverflow
Solution 4 - XcodeandrewmcleanView Answer on Stackoverflow
Solution 5 - XcodeAdam FoxView Answer on Stackoverflow
Solution 6 - XcodePhat LeView Answer on Stackoverflow
Solution 7 - XcodehashierView Answer on Stackoverflow
Solution 8 - XcodealloyView Answer on Stackoverflow
Solution 9 - XcodetoutiView Answer on Stackoverflow
Solution 10 - XcodeLeon DeriglazovView Answer on Stackoverflow
Solution 11 - XcodeKhanan GrauerView Answer on Stackoverflow
Solution 12 - XcodeKrauseFxView Answer on Stackoverflow
Solution 13 - XcodeAzabAFView Answer on Stackoverflow