railscasts.com/episodes/245-new-gem-with-bundler

To make a gem:

gem build ec2_setup.gemspec