Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to switch cocoapods (or other gem) version on command line?

There are some answers saying using gem 'cocoapods', '0.33.1' or gem 'pod', '0.33.1

but this does not work.

ERROR: While executing gem ... (Gem::CommandLineError) Unknown command cocoapods,

In one project I need to use 0.33.1, but 0.34.4 in another. How do I switch the cocoapods version quickly on command line? I don't want to use gem install or uninstall.

I am using rbenv with ruby version 2.0.0p0. Keep using rbenv is preferred but I can switch to rvm or pure ruby only if there is no other options.

Thanks.

like image 873
fangmobile Avatar asked Jan 24 '15 22:01

fangmobile


People also ask

How do I downgrade my Mac from CocoaPods?

All I had to do to revert to 0.37 was run your comment sudo gem uninstall cocoapods and then pick 0.38 from the automatically presented list. Within seconds I was back on 0.37, and my pod install worked again!

What version of Ruby does CocoaPods use?

Required Ruby Version: >= 2.0.

What is the current version of CocoaPods?

1.11. 2 - September 13, 2021 (287 KB)


1 Answers

You can do the following to use different versions:

pod _0.34.4_ install 

or

pod _0.34.1_ install
like image 200
rantunes Avatar answered Oct 26 '22 22:10

rantunes