Creating my first Ruby .gem

Soon after discovering Ruby, I discovered Rubygems, which are packaged ruby code libraries that be easily installed and managed. For example, Rails is also a Ruby .gem.

After some time, I found myself writing some custom helpers that I like to use between projects, and I wanted to be able to release .gems for other people to use, so I decided to make my own.

Here's where I started:

bundle gem opengov  => creates an opengov directory and all the files I need to get started writing my gem.

In the 'opengov' directory, I ran 'git init' to start a Git repository, then I checked in the initial files that were generated.

I updated the 'opengov.gemspec' file to give the .gem a Description and a Summary, then ran build gem opengov.gemspec, which built the first version of the Ruby .gem, that was versioned 0.0.1, based on the /version.rb file.

I was able to publish the .gem to Rubygems because 'opengov' was not already taken, surprisingly. The command was 'gem push opengov-0.0.1.gem', which did the trick.

I proceeded to push the code to Github, where it is open-sourced and available for anybody to use.

About Afomi

Afomi is the digital sandbox of Ryan Wold, who is always evolving this to better share inspirations and aspirations.

About Ryan

Ryan is a systems-thinking Product Developer and Designer who practices agile, test-driven, and lean continuous software delivery, while solving problems with people.