Bundler: Releasing a gem with enabled 2FA
Rubygems supports a 2FA for your account. Once enabled you need to provide your personal OTP code for every release. Despite the CLI of the
rake release task does not work well with the command promt for your OTP code with Bundler versions
< 2.0.2. It just looks like the task is frozen:
- Workaround 1: Just type your OTP code and hit enter, your gem is released afterwards.
- Workaround 2: Upgrade to Bundler >=
2.0.2.. Your supported Ruby versions for this gem must be
When you need to release a gem using an old Ruby version
If you need to release a gem with a legacy Ruby version like 1.8.7, the workarounds above won't work for you.
In this case, switch to a modern Ruby version only to make the release, then switch back.