Finding Gems

Tips on finding Gems

  1. First search GitHub (filter for language ruby, order by bemost recent, and add the term gem to the search.)

  2. If they’ve been updated in the last 6-12 months it’s a fair bet that they’ll work for your project. If they haven’t been touched in a few year… they’re likely out of date, not maintained and full of hassel.

  3. DM if you want to check a gem’s OK to use for your projects

Where to look

Beyond Github, there are two great places to search for community developed Gems:

Rub Gems is of course another great resource.

Ruby Toolbox - allows ruby users to find gems according to their specified needs. All the gems listed in this website are categorized by group, allowing users to easily find gems that are related to their project. Each gems will have basic information listed to provide quick overview of what it does, what the current version is and how many times the gem has been downloaded. However, since this website is run personally by the creator, Christoph Olszowka, it might not have the latest list of gems available online.

Some Rules of Thumb for Using Gems

1. Check if it’s fresh. If it’s not look again

When you look at the GitHub repo, chech the Gem has been updated wihtin the last 12 months. Why? Because this tells you if someone is maintaining it (editing the code and keeping it current). For Gems that work with APIs or web content, it’s generally a good indication it’s current and working.

2. If the isn’t helpful, it might be a headache.

If the developer hasn’t given some simple starting points on how to use the code, you’re going to have to work out how to use it on your own. It also tells you something about who the developer has made the gem for. Are they thoughtful enough to give the whole wide world clear instructions on how to use their tool? If not you’re probably going to hit pain points in using it.

3. Check to see if the repo has a WiKi

There’s sometimes a tab on GitHub, called ‘Wiki’ and that has troubleshooting, installation guides, code snippets and other stuff for more complex gems.

4. Search and Google with the gem name

If there’s no code starts but you really need to use this gem, search Stackoverflow. It’s generally a great starting point for two reasons. First, it tells you if other people are using it and if it’s worth your time. Two, it shows you if someone else has run afoul of similar issues.

Hopefully someone has some starter code there to get you off the ground too.

5. Try adding it to your code (Gemfile + require). bundle install. If there’s an error, skip it.

If you think this is the gem for you. Try it out. The first thing you should do is add the gem to your Gemfile and the require gemname at the top of your code. Quit your server (control + c), do a bundle install, and then fire it back up again.

Try out your app and if you get a huge big blazing error, there’s probably some issue with the gem.

6. Hunt for any requirements the gem might have

Does your Gem connect to the web or use an API? Then you probably need some developer information, an account, or some auth tokens? If so get that first - because it’s likely why you might be getting errors!

7. Try it out with some basic starter code

If you’ve got the gem installed, configured and all looks ok: Then try something simple with it first.

Use some boilerplate code or try to get one simple function of it to work in your application

If it takes more than 20 mins to get the basics working, scrub it.



The latest tutorials sent straight to your inbox.