ruby使用国内的镜像操作方法

xiaoxiao2021-02-28  98

请尽可能用比较新的 RubyGems 版本,建议 2.6.x 以上。

$ gem update --system # 这里请翻墙一下 $ gem -v 2.6.3 $ gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/ $ gem sources -l https://gems.ruby-china.org # 确保只有 gems.ruby-china.org
如果你使用 Gemfile 和 Bundler (例如:Rails 项目)

你可以用 Bundler 的 Gem 源代码镜像命令。

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

这样你不用改你的 Gemfile 的 source。

source 'https://rubygems.org/' gem 'rails', '4.2.5' ...
转载请注明原文地址: https://www.6miu.com/read-53786.html

最新回复(0)