I am trying to setup cocoapods to my iOS application But when I go for command:
sudo gem update --system
I get error : Latest version currently installed. Aborting.
When I go to next step for cocoapods:
sudo gem install cocoapods
I get error on Mac OS 10.8.5 :
ERROR: Error installing cocoapods:
cocoapods-trunk requires Ruby version >= 2.0.0.
I tried same on Mac OS 10.9.4 and getting error :
ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ECONNREFUSED: Connection refused - connect(2) (https://rubygems.org/latest_specs.4.8.gz)
Cocoapods is built on top of Ruby, so you would need to install that in your system before using Cocoapods.
CocoaPods is built with Ruby and it will be installable with the default Ruby available on macOS. You can use a Ruby Version manager, however we recommend that you use the standard Ruby available on macOS unless you know what you're doing.
When you run pod update PODNAME , CocoaPods will try to find an updated version of the pod PODNAME , without taking into account the version listed in Podfile. lock . It will update the pod to the latest version possible (as long as it matches the version restrictions in your Podfile ).
I had this same problem and found it was due to having an older version of Ruby installed (even though my OS X is 10.10.2). You will need to uninstall the old version and install a newer version of Ruby. These steps worked for me:
Try rvm ls
to see if you have a newer version installed. If you do, just use it with rvm use ruby-2.2.0
, for example.
If you don't have an unused compatible version, uninstall the old version: rvm uninstall [your ruby version]
(you may have to uninstall cocoapods first if this line gives you an error). Use rvm current
to see what version you're running.
Install version 2.2.0 (or use rvm list known
to see all available versions;
2.2.0 worked for me, but 2.2-head did not): rvm install ruby-2.2.0
When it's done: rvm --create ruby-2.2.0
, and then rvm use ruby-2.2.0
Reinstall cocoapods
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With