rustylepord
rustylepord

Reputation: 5801

Install multiple version of cocoa pods

Is it possible to install multiple versions of cocoa pods on the same machine ? I need one project to be build from cocoa pod 0.33 and another one from the latest version. Is this possible ?

Upvotes: 15

Views: 11039

Answers (4)

FishStix
FishStix

Reputation: 5114

You can use bundler. CocoaPods even recommends this from their site

In the root of your project, include a Gemfile:

source 'https://rubygems.org'

gem 'cocoapods', '1.0.0'

You can customize the version of cocoapods used for each project in its local Gemfile. To run, simply call your pod commands from bundler (after running "bundle install"):

bundle install
bundle exec pod install
bundle exec pod update

Upvotes: 3

Steven B.
Steven B.

Reputation: 1539

I've made a small list of commands to use multiple versions of cocoapods, all tested with osx sierra 12.1, xCode 8

  • View all installed versions of cocoapods :

    gem list --local | grep cocoapods

  • Install a specific version of cocoapods with gem

    gem install cocoapods -v 0.33.0

  • Install pods with specific version of cocoapods (change to your wanted version):

    pod _0.33.0_ install

All versions of Cocoapods can be found HERE

Upvotes: 9

diidu
diidu

Reputation: 2863

When you install new version of cocoapods, the old one is not removed unless you explicitly remove it with

gem uninstall cocoapods

and select the version to be removed.

You can use the old versions by giving version number in the command, surrounded by underscores, like this:

 pod _0.38.2_ install

Since November 11, 2016 the master repo is not compatible with the old version and unless you have updated your Podfile correctly (replaced source "https://github.com/CocoaPods/Specs.git" with source "https://github.com/CocoaPods/Old-Specs" or just added the latter one) you will see an error when using 0.x version of cocoapods:

"[!] The master repo requires CocoaPods 1.0.0 -  (currently using 0.38.2)"

Information on how and why is here.

Upvotes: 26

KP_G
KP_G

Reputation: 470

Yes, It is. But for different users. Build one from user 1 and other from user 2.

$ gem install cocoapods --user-install

Upvotes: 3

Related Questions