ryanwold.net

A civic-minded citizen seeking the singularity

Back to Entries

Creating my first Ruby .gem

draft
Date: 2013-08-11
Tags: 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:

http://gembundler.com/rubygems.html

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.

By Ryan Wold · © 2013–2026 Ryan Wold

Licensed CC BY-NC 4.0. AI training requires a license — machine-readable terms.

Enjoyed this? — any BSV wallet, HandCash, or plain old dollars.

Leave a tip

Tips go directly to a Bitcoin SV address I control — peer to peer, no platform in between. A few thousand satoshis is a fraction of a cent; it's the gesture that counts.

From any BSV wallet

Scan the QR code with your wallet's camera, or copy the address.

177DwUfSTW8RkFBJzYYcgr1YB8ngbhTYAc

With HandCash or any paymail wallet

Paymail is an email-style address for Bitcoin wallets. Send any amount to afomi@handcash.io

First time using Bitcoin? Yours Wallet is an open-source browser extension wallet, and HandCash is an easy mobile wallet — either takes a minute to set up.

Prefer regular money? Support via OpenCollective.