Creating Ruby gems has always been a bit of a pain. When you get right down to it, it's not a hard thing to do, but it's easy to forget how if you don't do it often enough. There are quite a few gems to help you write other gems, but if you're using Rails 3, there's already a gem on your system that does this: Bundler.
Not only does Bundler help you manage and install gem dependencies in your projects (most notably your Rails projects), it will also generate a stub gem project for you, complete with Rakefile and directory structure. The Rakefile is fully featured, and will create gem packages and publish them on RubyGems.org. The Rakefile will even tag releases in your Git repository and push them to GitHub (or, presumably, any other external).