Robert's Homepage

How to Publish a Ruby Gem

#ruby #ruby-gems #development #how-to

This how to will provide the steps necessary for releasing a Ruby gem to rubygems.org. Before proceeding, ensure that you have configured your local setup to push to the rubygems.org registry programmatically via the gem cli. See this tutorial to setup an api key and configure your local machine

  1. First build the gem to verify that it builds
bundle exec rake build
  1. Tag the current branch and push changes up to the repository
git tag ...
git push --tags
  1. Run the rake release task via:
bundle exec rake release
  1. Enter the TOTP code to confirm

  2. Create a GitHub release

gh release create