gem yank (<3.1.0) 返回“您已启用多因素身份验证但未提供 OTP 代码”但您无法在命令行上提供

问题描述

错误

You have enabled multifactor authentication but no OTP code provided. Please fill in an retry.

如果您的 Gem

enter image description here

如您所见,如果您提供选项--opt,它仍然不起作用,因为它告诉您--otp 是一个无效选项

invalid option: --otp=112914

解决方法

如果您的 gem 版本是

它已在 ruby​​gems 3.1.0 中修复

注意,因为它是一个自我更新的二进制文件,更新它的方式是

gem update --system

检查您的版本使用

gem -v

这是一个已知问题,已在 Gem 3.1.0 版中修复

如果您有 gem --otp 不是有效选项。