How to pick a good gem for Ruby on Rails project?

For years in Ruby on Rails development, I notice this developer can have advantages of its community by its reach gems. Those gems are helpful and rich features. Even so, I heard from some newbie that mentioned about some awful gems. I decided to take look. Oh no! some gems have never committed for years, some are deprecated and inactive.

A lot of my connection ask me about how do I pick a gem? So that why in this blog post I will describe some audition before I make decisions to use that gem. Below are the questions to ask before you pick a gem.

First, you need to pick the popular gem. How can I know it is a popular gem? Well for me first look at the stars. At GitHub on the top right, you can how many stars of the gem. The developer will give a star when they like it after using it. Do some Google with gem name. If the gem is popular you will see people mention it in the forum like Reddit or StackOverflow or someone may write a blog about how to use it.

Is it active?

Then you need to look at last commit whether the gem gets some contributed lately. You should check on some issues if the open issue has some recent reply. Also, you can take a look on the pull requests whether the contributor has open a few pull request or they have conversations on it recently. Does it have less bug? You should go to issues. Review a few interesting issues then you’ll feel how it go. Some gems have the bug that stuck development for months and never gets it to fix.

Is it easy to modify?

This is a bit of senior level. You can read the gem source and see how it feel. It is rare but sometimes I presume the worst case when need to fork or contribute to the gem for the feature it doesn’t have and the bug that didn’t fix. So if the code is clean l, you will feel confident to go.

This is the steps for my personal use. It doesn’t mean the gem needs to match all of the requirement. But you can use it to decide whether or not to use that gem.