Getting Error Configuring Cocoa Substrates and Installing Updates for Ruby

I am trying to configure cocoapods on my iOS application. But when I go for the team:

sudo gem update --system 

I get an error: latest version currently installed. Aborting

When I move on to the next step for cocoapods:

 sudo gem install cocoapods 

I get an error in Mac OS 10.8.5:

 ERROR: Error installing cocoapods: cocoapods-trunk requires Ruby version >= 2.0.0. 

I tried the same on Mac OS 10.9.4 and got an 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)​ 
+5
source share
1 answer

I had the same problem and found that it was due to the fact that an earlier version of Ruby was installed (although 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 a new version is installed. If you do this, just use it with rvm use ruby-2.2.0 , for example.

  • If you do not have an unused compatible version, uninstall the old version: rvm uninstall [your ruby version] (first you need to remove cocoapods if this line gives you an error). Use rvm current to find out which version you are using.

  • Install version 2.2.0 (or use rvm list known to view all available versions; 2.2.0 worked for me, but 2.2-head did not): rvm install ruby-2.2.0

  • When this is done: rvm --create ruby-2.2.0 , and then rvm use ruby-2.2.0

  • Reinstall cocoapods

+9
source

Source: https://habr.com/ru/post/1214545/


All Articles