16

My system contain more than cocoapod version(like cocoapods (1.2.0, 1.1.1, 1.0.1, 1.0.0, 0.39.0, 0.38.2)).I want to switch to 0.39.0 version. How to switch to this specified version?

7
  • are you using a gemfile? Feb 17, 2017 at 10:00
  • no i amusing only podfile
    – JAK
    Feb 17, 2017 at 10:22
  • Any reason you can't just use the newest version? If not then just uninstall all and reinstall version 0.39.0 like Brijesh said Jul 6, 2017 at 21:23
  • @Bryan My mac contain latest pod version,but I want to switch to older version because my xcode project podfile.lock contain older cocoapod version.
    – JAK
    Jul 7, 2017 at 5:00
  • Have you tried pod _0.39.0_ setup? Found from https://stackoverflow.com/a/31772875/5470541 Jul 7, 2017 at 9:32

7 Answers 7

21

first remove the current cocoapod version as

sudo gem uninstall cocoapods

and then install the version what you want as

sudo gem install cocoapods -v 0.39.0
1
  • I already installed it.But need to only switch between different versions..
    – JAK
    Feb 17, 2017 at 9:23
14

You can run install command by specifying the version of cocoapods . like below .

pod _0.38.2_ install 

or

pod _0.39.0_ install

you can also run other command like setup and other just like above .

I hope this will help you to switch to this specified version of cocopods :)

7

see this Managing Ruby Tools with Bundler

create a ne textfile called Gemfile in the same folder as your project

it contains

source 'https://rubygems.org'
gem 'cocoapods', '0.39.0'

you also need to have installed bundler

$ gem install bundler

after that enter the following command in your terminal at the project level

$ bundle install
$ bundle exec pod install

now only the pod version defined in you Gemfile and the pod versions defined in your podfile should be used, not the global ones.

3

You can specify the version of the Cocoapods you want to use directly after the pod command: pod _0.39.0_ setup

2

Install specific version with this command example,

sudo gem install cocoapods -v 0.39.0
1

try this:

sudo gem install cocoapods -v 0.39.0
-1

Switch 1.7.5 to 1.7.0 :))

Last login: Mon Aug 19 10:24:50 on ttys000
 ~  pod --version
1.7.5
 ~  gem list cocoapods

*** LOCAL GEMS ***

cocoapods (1.7.5, 1.7.0, 1.5.3, 1.1.1)
cocoapods-core (1.8.0.beta.1, 1.7.5, 1.7.0, 1.6.1, 1.5.3, 1.3.1, 1.2.1, 1.1.1)
cocoapods-deintegrate (1.0.4, 1.0.2, 1.0.1)
cocoapods-downloader (1.2.2, 1.1.3, 1.1.2)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-stats (1.0.0)
cocoapods-trunk (1.3.1, 1.2.0, 1.1.1)
cocoapods-try (1.1.0)
 ~  gem uninstall cocoapods -v 1.7.5
ERROR:  While executing gem ... (Gem::InstallError)
    cocoapods is not installed in GEM_HOME, try:
    gem uninstall -i /Users/admin/.rvm/gems/ruby-2.3.0@global cocoapods
 ~  sudo gem uninstall cocoapods -v 1.7.5
Password:
Successfully uninstalled cocoapods-1.7.5
 ~  gem list cocoapods

*** LOCAL GEMS ***

cocoapods (1.7.0, 1.5.3, 1.1.1)
cocoapods-core (1.8.0.beta.1, 1.7.5, 1.7.0, 1.6.1, 1.5.3, 1.3.1, 1.2.1, 1.1.1)
cocoapods-deintegrate (1.0.4, 1.0.2, 1.0.1)
cocoapods-downloader (1.2.2, 1.1.3, 1.1.2)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-stats (1.0.0)
cocoapods-trunk (1.3.1, 1.2.0, 1.1.1)
cocoapods-try (1.1.0)
 ~  pod --version
1.7.0
1
  • 1
    This is not switching at all.
    – funct7
    Oct 9, 2019 at 7:10

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.