Release gem; Deploy gem; Update a gem created with Jeweler

Updated . Posted . Visible to the public. Deprecated.

This card describes our current workflow.

Until May 2011 our gems Show archive.org snapshot have been created with Jeweler, which is a helper library to package code into a gem. You know a gem was cut with Jeweler if you see the word jeweler in a gem project's Rakefile.

This note describes how to update a gem that was cut using Jeweler. Note that this can be traumatic the first time. It would be great to have an easier workflow for this. Jeweler is deprecated these days because you can

now cut gems more easily using Bundler.

Easy mode

  • Check out a repository from Github like git clone git@github.com:makandra/aegis.git
  • Make and commit your changes. You can but don't need to push the changes.
  • Bump the gem version using rake version:bump:<major|minor|patch>. This will create an unpushed commit for the bump. If the rake task doesn't exist, you are probably defining the gem version in the Rakefile instead of in VERSION. Change this.
  • Say rake release. This will do many things for you:
    • Generate GEMNAME.gemspec and commit it
    • Push commits to the repo
    • Add and push a tag like "v0.1.0" to the repo
  • For unknown reasons (please find out) rake release will sometimes build and push the .gem package to RubyGems.org. This seems to happen in some projects and not in others. Check the console output if that has already happened. If not:
    • rake build
    • Get credentials for Rubygems.org from the team
    • gem push pkg/[GEMNAME]-[VERSION].gem
  • The gem will be available on RubyGems.org after about 5 minutes
  • Install your own gem with sudo gem install GEMNAME

Hard mode

  • Check out a repository from Github like git clone git@github.com:makandra/aegis.git
  • Make and commit your changes
  • Bump the gem version using rake version:bump:<major|minor|patch>. This will create an unpushed commit for the bump.
  • Update the gemspec with rake gemspec
  • Commit the gemspec changes
  • Push
  • rake build
  • Get credentials for Rubygems.org from the team
  • gem push pkg/[GEMNAME]-[VERSION].gem
  • The gem will be available on RubyGems.org after about 5 minutes
  • Install your own gem with sudo gem install GEMNAME
Henning Koch
Last edit
License
Source code in this card is licensed under the MIT License.
Posted by Henning Koch to makandra dev (2010-08-25 13:58)