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?

IKKA
  • 6,297
  • 7
  • 50
  • 88

7 Answers7

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
Ram
  • 961
  • 6
  • 14
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 :)

Dhiru
  • 3,040
  • 3
  • 25
  • 69
6

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

Oleg Danu
  • 4,149
  • 4
  • 29
  • 47
2

Install specific version with this command example,

sudo gem install cocoapods -v 0.39.0
Vikash Kumar
  • 642
  • 1
  • 11
  • 25
1

try this:

sudo gem install cocoapods -v 0.39.0
Brijesh Shiroya
  • 3,323
  • 1
  • 13
  • 20
-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
Giang
  • 3,553
  • 30
  • 28