Search code examples
rubyxcoderubygemscocoapods

Unable to install 'cocoapods' gem from rubygems.org (bad response backend read error)


I'm getting an error when I run 'gem install cocoapods' on OSX Mavericks.

$ gem install cocoapods
ERROR:  Could not find a valid gem 'cocoapods' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - bad response backend read error 503 (https://rubygems.global.ssl.fastly.net/quick/Marshal.4.8/cocoapods-0.27.1.gemspec.rz)
ERROR:  Possible alternatives: cocoapods

Please note that I can download the cocoapods-0.27.1.gemspec.rz directly. I am running the latest version of XCode (5.0.1) and the latest version of its CLI tools. RVM is also configured to run the latest Ruby version (2.0.0p247)


Solution

  • Though I'm not sure what caused read error 503 I was able to work around the problem fairly easily by manually installing the cocoapods.gem.

    If anyone else experiences similar problems (with cocoapods or any other gem), download the appropriate gem file (cocoapods-0.27.1.gem in my case) directly from RubyGems.org. Then run the gem install cocoapods-0.27.1.gem. The install command will scan the working directory first, thus detecting and installing the local gem package, cutting out the broken repository.