Creating my first gem

You’re closer than you think to a career in tech. Our grads have launched rewarding new careers — you can too.

View Our Jobs Report

The following is a guest post by Scott Luptowski and originally appeared on his blog. Scott is currently in the Ruby-003 class at The Flatiron School. You can follow him on Twitter here.

A few weeks ago, I built a Ruby script to find the current standings of the English Premier League and display them in the terminal. I decided to turn my standalone script into a gem called Standings, and the process was both easier and harder than I imagined.

Gems are built using a file called a .gemspec, which contains a list of metadata about your gem. It includes things like the version number, author’s name, and a list of runtime depencies (gems which will automatically download if you do not already have them).

Before I began the gem process, I assumed that the hardest part would be allowing computers to run the gem by typing its name directly from the command line, rather than inside of a pry session. It turns out that this was one of the easiest parts.

Blog post image: tumblr_inline_mv2ti9aLYJ1rtan47.png

It turns out that what you’re doing here is adding information about the gem to your system’s PATH, which lets you call it from bash. Everything made more sense once I understood that.

Another issue I had was with properly requiring the correct files inside my actual gem. In a worrying turn of events, my computer read my code properly, while a classmate’s gem installation process did not work. My problem was in code which required all necessary files: some file invoked classes which were not yet defined, leaving Ruby very confused. I rearranged the require_relative statements and it worked fine, but I’m still not sure what caused the error on one computer and not the other.

When it came to actual deployment, pushing the gem was painless. I created an account on and typed gem push standings from my terminal. In the future I’d like to add error handling, better notifications, and more documentation. I’d also like to include more soccer leagues via implementation of command line arguments.

Overall this was a great experience and I can’t wait to continue to play with the gem.

Headshot of Flatiron School

Flatiron School

Blog Post Author

Read More Flatiron School Articles

Since we opened our doors in 2012, thousands of students have joined Flatiron School to launch new careers in tech.

Explore our Courses

Find the perfect course for you across our in-person and online programs designed to power your career change.

Explore Our Courses
Join a Community

Connect with students and staff at meetups, lectures, and demos – on campus and online.

Join the Community
Schedule a Chat

Have a question about our programs? Our admissions team is here to help.

Schedule a Chat