Solve the problem that rubygems.org cannot be accessed!

Posted Jun 15, 20201 min read

Bundle used in my blog, every time I want to bundle install, I may encounter the problem of inaccessibility:

Solution Ruby China official website Yes, just replace the mirror source:

Here is a record of my process to facilitate direct configuration in the future:

1. Update gem

No sudo added, suggesting that I need root permissions, so I added permissions:

sudo gem update --system

Check the updated version 2.7.7 No problem:

gem -v

2.7.7

2. bundle config modify ruby-china mirror

The official website says that the project using Gemfile and Bundler can directly execute the following command to replace the mirror without modifying the Gemfile file:

bundle config mirror.https://rubygems.org https://gems.ruby-china.com

Then I executed bundle install and got it: