Last Updated: February 25, 2016
·
474
· markets

Prevent private Gem being pushed to RubyGems (Bundler)

If you manage your gems using Bundler, you normally release the gem by the provided task:

rake release

More or less, this command do:

  • Build the package
  • Add a Git tag
  • Push to RubyGems

This workflow is enough for most of cases, but if you're building a private gem, you probably want/need to skip last step. Bundler provides an ENV variable to achieve that with ease (add it at the top of your Rakefile):

ENV['gem_push']  = 'off'