Post

使用gem镜像源

科学上网不能解决连接到ruby源卡死的问题,如jekyll本地编译。原因不明。

需要清空gem源并重新设置为https://gems.ruby-china.com/

不是.org

1
2
3
4
5
6
7
8
# Check current gem sources
gem sources --list
# Remove obsolete gem sources
gem sources --remove https://rubygems.org/
# Add the mirror site
gem sources --add https://gems.ruby-china.com/
# Clear and update gem sources
gem sources --clear && gem sources --update

注意,如果托管在GitHub上Gemfile不要修改镜像,否则容易出现连接错误

This post is licensed under CC BY 4.0 by the author.