6

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?

William Entriken
  • 37,208
  • 23
  • 149
  • 195
Sancho Sanchez
  • 590
  • 1
  • 6
  • 19
  • I already tried this and get `gem update --system Latest version currently installed. Aborting.` then `gem install cocoapods ERROR: While executing gem ... (Gem::RemoteFetcher::UnknownHostError) no such name (https://api.rubygems.org/api/v1/dependencies?gems=cocoapods-trunk)` – Sancho Sanchez Jun 04 '14 at 16:43
  • You probably need to reinstall Ruby – Keith Smiley Jun 04 '14 at 18:43

2 Answers2

13

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 !

Sancho Sanchez
  • 590
  • 1
  • 6
  • 19
  • 3
    After the curl, I used: `source /Users/anthonyjmay/.rvm/scripts/rvm` then `rvm rubygems latest --force`, then `sudo gem install xcodeproj`, and finally `sudo gem install cocoapods` Appears this issue is related to the ruby upgrade in Yosemite. – amay0048 Jun 11 '14 at 09:03
  • Thanks Sancho! And Thank you amay0048 for complementing this answer. Works great! – f0rz Sep 21 '14 at 15:35
  • Nice one Sancho and ama0048! Following both your steps worked. – johnyorke Oct 07 '14 at 15:41
  • still not working for me. Terminal code stuck at line **GET https://api.rubygems.org/quick/Marshal.4.8/xcodeproj-0.26.1.gemspec.rz 302 Moved Temporarily** – Saurabh Prajapati Jul 07 '15 at 11:38
0
brew install ruby 

can do the work too, after that

sudo gem install cocoapods

It did worked in my yosemite

pd farhad
  • 6,352
  • 2
  • 28
  • 47