Updating a gem created with Bundler

Since May 2011 we are cutting new gems using Bundler Show archive.org snapshot , which is less painful than cutting gems using Jeweler. You know a gem was cut using Bundler if you see the word Bundler in a gem project's Rakefile.

This is how to update a gem that was cut using Bundler:

  • Say git pull or check out a repository from Github like git clone git@github.com:makandra/geordi.git
  • Update the gem version in lib/project/version.rb
  • Make and commit your changes. You can but don't need to push your changes to Github.
  • If you haven't logged in to Rubygems.org before:
    • Get credentials for Rubygems.org from the team
    • Say rake release, which will do everything right unless you haven't entered Rubygems credentials before
      • In that case kill the hanging rake release
      • Say gem push path/to/packaged.gem (e.g. pkg/geordi-1.2.3.gem) manually, so gem will properly prompt you for your credentials
      • For this time you're done. In the future, you only need to say rake release.
  • Say rake release. This will do many things for you:
    • Builds a gem package to e.g. pkg/geordi-1.2.3.gem
    • Adds and pushes a tag like "v1.2.3" to the repo
    • Pushes commits to the repo
    • Pushes the .gem package to Rubygems.org (what you could do manually by saying gem push pkg/geordi-1.2.3.gem)
  • The gem will be available on RubyGems.org after about 5 minutes
  • Install/update your own gem with sudo gem install GEMNAME
Henning Koch