Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OS X Yosemite : Impossible to install cocoapods

I have ruby version : ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0] When I try install cocoapods i get :

$ sudo gem install cocoapods -V

ERROR:  Could not find a valid gem 'cocoapods' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - no such name (https://api.rubygems.org/latest_specs.4.8.gz)
GET https://api.rubygems.org/prerelease_specs.4.8.gz
302 Moved Temporarily
GET https://s3.amazonaws.com/production.s3.rubygems.org/prerelease_specs.4.8.gz
200 OK
GET https://api.rubygems.org/specs.4.8.gz
302 Moved Temporarily
GET https://s3.amazonaws.com/production.s3.rubygems.org/specs.4.8.gz
200 OK
ERROR:  Possible alternatives: cocoapods

Someone to help me solve this?

like image 725
Sancho Sanchez Avatar asked Jun 04 '14 13:06

Sancho Sanchez


People also ask

Should I install CocoaPods with GEM or homebrew?

I would suggest you install CocoaPods using brew . It's a little cleaner option and you can update it easier. The cocoapods cask is for CocoaPads App and the formula is for the CLI only version.

How do I install CocoaPods?

To install the pods, do one of the following: Place the caret at the code line where you add the pod, press ⌥ ⏎ , select Install, and press ⏎ . Click Install pods in the top-left corner of the editor window. From the main menu, select Tools | CocoaPods | Install.

Is CocoaPods a ruby gem?

What is CocoaPods? CocoaPods is a dependency manager for Cocoa and Cocoa Touch projects which covers macOS, iOS, watchOS and tvOS development. It is written in Ruby and distributed through RubyGems.


1 Answers

It appears that at this day HomeBrew has few issues with OSX Yosemite. I solved my issue by deleting ruby using the command :

brew uninstall ruby

and then installing rvm and ruby again with RVM:

curl -L https://get.rvm.io | bash -s stable --ruby
rvm rubygems latest

then gem install cocoapods worked like a charm !

like image 148
Sancho Sanchez Avatar answered Oct 20 '22 09:10

Sancho Sanchez