Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a CocoaPods project work on OS X El Capitan & Xcode 7 Beta?

I've updated to OS X El Capitan & Xcode 7 Beta released today and now my CocoaPods projects no longer work because of the new Swift syntax requirements. The automated Xcode project update breaks the code. Has anyone already figured this out already? Thanks.

like image 941
Kris Haamer Avatar asked Jun 09 '15 00:06

Kris Haamer


People also ask

Why we use CocoaPods in iOS?

CocoaPods will resolve dependencies between libraries, fetch the resulting source code, then link it together in an Xcode workspace to build your project. Ultimately the goal is to improve discoverability of, and engagement in, third party open-source libraries by creating a more centralised ecosystem.

How CocoaPods works?

Cocoapods uses workspace to automate the build process and manage implicit dependencies. Cocoapods setup all necessary info into your consumer project(like Search pats, etc). When you build the consumer project Xcode pull pods and assemble all together.


3 Answers

It worked for me for the bug when run Cocoapods on El Capitan 10.11 following this guide:

export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/bin:$PATH

gem install cocoapods
like image 95
huync Avatar answered Oct 17 '22 22:10

huync


Until Cocoapods supports Swift 2, at the very least you should be able to continue to use Xcode 6 until it does. If Xcode 7 has stomped all over your Cocoapods already, this link shows you how to clean it up https://gist.github.com/mbinna/4202236.

Basically, from inside any project using Cocoapods:

rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update

Then rebuild using Xcode 6 and everything should be back to normal.

like image 20
Marius Kjeldahl Avatar answered Oct 17 '22 21:10

Marius Kjeldahl


I did this to make it work for me:

brew install ruby
/usr/local/bin/gem install cocoapods
like image 6
Steffen Brem Avatar answered Oct 17 '22 22:10

Steffen Brem