Building a gem consists mainly of creating a simple directory structure for your script and a special file known as gemspec that will list all its dependencies. This gemspec can be used with rubygems to create a gem file (* .gem) that can be installed using rubygems or uploaded to rubygems.org for public consumption.
There are several tools that automate part of this process. Relatively simple is the Bundler gem, which will take care of dependencies during development and make it easier for you to pack your gem. This article contains enough information to get started with gem development using bundler.
source
share