Shamsiddin Saidov
Shamsiddin Saidov

Reputation: 2281

Ruby gems. Unable to add sources

I had this problem "https://stackoverflow.com/questions/19612185/unable-to-install-cocoapods-gem-from-rubygems-org-bad-response-backend-read-e" and as one of the solutions said I tried to remove/add rubygem sources. It was removed without problem, but when I tried to add it back it's giving me an error. Here's my action on terminal and response:

$ gem sources --add https://rubygems.org/
Error fetching https://rubygems.org/:
    server did not return a valid file (https://rubygems.org/specs.4.8.gz)

Does anyone know what is the problem?

Upvotes: 1

Views: 1183

Answers (2)

Super Developer
Super Developer

Reputation: 897

Here is Easy Steps for installing Ruby in your system to help to install Cocoapods in your machine, I solved the same issue with being below mentioned steps.

  1. Install command line tools using the command
xcode-select --install
  1. Install Homebrew by
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  1. Install Ruby using homebrew
brew install ruby
  1. Check Ruby version
ruby -v
  1. Install Ruby
gem source -a http://rubygems.org/
  1. gem install cocoa pods
sudo gem install cocoapods

or

sudo gem install -n /usr/local/bin cocoapods
  1. Go to below folder
cd ~/.cocoapods/repos
  1. Run the below command
git clone https://github.com/CocoaPods/Specs.git master
  1. Go to the directory where Podfile is present and run
pod install

Happy Coding😊

Upvotes: 2

S.Jain
S.Jain

Reputation: 441

Steps: 1. sudo gem install cocoapods 2. pod install 3. pod update

ensure that you are connected to internet. Your system is unable to find the latest version of gems, required by pods

Upvotes: 1

Related Questions