一、更新gem
1.查看gem版本号
gem -v
2.查看ruby源。
gem sources -l
3.替换ruby源(如果是https://gems.ruby-china.com, 则跳过3、4步)
gem sources --remove https://gems.ruby-china.org
gem sources --add https://gems.ruby-china.com
注意是https://gems.ruby-china.com 不是https://gems.ruby-china.org.
4.确保ruby源是https://gems.ruby-china.com
gem sources -l
5.更新gem版本
gem update --system
如果错误:
>ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.
使用:
sudo gem update --system
6.打印gem版本号 是否成功
gem -v