While executing gem ... (Gem::RemoteFetcher::FetchError)

今天想准备升级一下cocoapods,但是发现更新不了
终端输入:

sudo gem update cocoapods

但是遇到如下问题:

ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    bad response Not Found 404 (https://gems.ruby-china.org/specs.4.8.gz)

什么?居然是404,于是我用浏览器打开https://gems.ruby-china.org,发现其服务域名更换了:

DF899F407A3A4BBAFDB9975960F2A318.png

于是删除gem源:

gem sources --remove https://gems.ruby-china.org/

修改gem源:

gem sources -a https://gems.ruby-china.com

查看gem源是否是最新的:

gem sources -l

升级cocoapods:

sudo gem install -n /usr/local/bin cocoapods --pre

查看升级后的cocoapods版本:

pod --version  // 当前版本为:1.6.0.beta.1

你可能感兴趣的:(While executing gem ... (Gem::RemoteFetcher::FetchError))