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 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
-
I already installed it.But need to only switch between different versions..– JAKFeb 17, 2017 at 9: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 :)
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.
You can specify the version of the Cocoapods you want to use directly after the pod
command: pod _0.39.0_ setup
Install specific version with this command example,
sudo gem install cocoapods -v 0.39.0
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
pod _0.39.0_ setup
? Found from https://stackoverflow.com/a/31772875/5470541