Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use a specific version of CocoaPods

Tags:

ios

cocoapods

Is it possible to somehow specific the version of CocoaPods I'd like to use when upgrading or installing a Podfile? I've encountered several times where Podfiles work correctly with one version of CocoaPods but not with others.

For example, the syntax I'm looking for is like the following:

pod -v 0.34 install 
like image 846
vondip Avatar asked Apr 02 '15 06:04

vondip


People also ask

How do I install pod specific version?

To install specific pod version, specify pod version after pod name. Besides no version, or a specific one, it is also possible to use logical operators: '> 0.1' Any version higher than 0.1. '>= 0.1' Version 0.1 and any higher version.


2 Answers

Since CocoaPods is installed through RubyGems you can use their mechanisms for doing this. As outlined here you can do this:

pod _0.34.0_ install 

You can verify this is working with:

pod _0.34.0_ --version 

Also I would highly advise against doing this at all. I would definitely recommend you keep CocoaPods up to date and change your Podfile as needed to adapt to new versions. At anytime your old version could stop working as expected if we bump the minimum version number.

like image 161
Keith Smiley Avatar answered Sep 25 '22 10:09

Keith Smiley


the ultimate solution:

  1. run a bash script to completely uninstall your current verison (Optinal)

    for i in $( gem list --local --no-version | grep cocoapods  ); do     sudo gem uninstall $i; done    sudo gem uninstall xcodeproj 
  2. install a specific verison of CocoaPod

    gem install cocoapods -v 0.39.0 
like image 24
MediumWell Avatar answered Sep 25 '22 10:09

MediumWell