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?
- 
                    are you using a gemfile? – sebastian friedrich Feb 17 '17 at 10:00
- 
                    no i amusing only podfile – IKKA Feb 17 '17 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 – Bryan Norden Jul 06 '17 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. – IKKA Jul 07 '17 at 05:00
- 
                    Have you tried `pod _0.39.0_ setup`? Found from [https://stackoverflow.com/a/31772875/5470541](https://stackoverflow.com/a/31772875/5470541) – Bryan Norden Jul 07 '17 at 09:32
- 
                    @Bryan Its not working for me – IKKA Jul 10 '17 at 03:57
- 
                    @JAK : did my answer helped you ? – Dhiru Jul 13 '17 at 05:47
7 Answers
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
 
    
    - 961
- 6
- 14
- 
                    I already installed it.But need to only switch between different versions.. – IKKA Feb 17 '17 at 09:23
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 :)
 
    
    - 3,040
- 3
- 25
- 69
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.
 
    
    - 901
- 7
- 9
You can specify the version of the Cocoapods you want to use directly after the pod command: pod _0.39.0_ setup
 
    
    - 4,149
- 4
- 29
- 47
Install specific version with this command example,
sudo gem install cocoapods -v 0.39.0
 
    
    - 642
- 1
- 11
- 25
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
 
    
    - 3,553
- 30
- 28
 
    