Rubygems.org’s Guides is one of the best resources for writing your own gem.
If you’re using Bundler in your app, you might want to look at Ryan Bigg’s guide to Developing a RubyGem using Bundler and the Railscast on creating gems with Bundler.
If you’re interested in tools to help you write gems:
- Jeweler – Opinionated tool for creating and managing Rubygem projects. There’s also a Gemcutter and Jeweler Railscast.
- Hoe – From the guys at seattlrb.
- gem-this adds a bunch of helpful rake tasks.
Some tutorials/guides:
- Creating Your First Gem
- Using bundler and rvm to build a rubygem – Using bundler and rvm to create a gem
- Gem Packaging: Best Practices
- Ruby Gem Recipe – Intro guide to creating a gem using bundler and jeweler
- How to build a ruby gem and host it on gemcutter – tutorial using echoe and gemcutter
- The Truth About Gemspecs – goes over gemspecs and tips for dealing with them
- Packaging with RubyGems – a quickstart guide for Jeweler
- gem that – James Adam – reviews tools that help build gems (hoe, newgem, echoe, gemhub, jeweler, gem this)
- Using Gemcutter’s Api from the Commandline
- New Gem with Bundler – Sample Rakefile – Useful rakefile for deploying and publishing a gem
- Let’s Write a Gem
- How To Build A Ruby Gem With Bundler, Test-Driven Development, Travis CI And Coveralls, Oh My!