12 Ruby Gems to make your Ruby coding smoother
Tags: ruby, webdev, programming, discuss
Published: 2023-08-22 17:25:29

How many Ruby gems do you have currently installed?

With around 50 new gems released daily, it is common to use trending libraries for managing everyday tasks. You probably use [Devise](https://github.com/heartcombo/devise) for authentication, [Cancan](https://github.com/ryanb/cancan) for authorization, [Kaminari](https://github.com/kaminari/kaminari) for pagination, or run tests with [Rspec](https://github.com/rspec/rspec).

From time to time, it is efficient to research new solutions. For this purpose, we have selected **12 gems in several important categories** that you should try. All of them have been released within the last two years or three, are regularly updated, and have already gained the trust of Ruby on Rails developers.

We’ve specified the release date and a number of downloads (within a given period of time) according to the [Ruby Toolbox](https://www.ruby-toolbox.com/).

---

## Active Record plugins
### [Pagy](https://github.com/ddnexus/pagy)
Pagy is an **agnostic library for pagination**. It is written in plain Ruby and is compatible with any framework and collection type.

It is a modern solution that significantly outperforms popular packages. It is [40 times faster and 36 times lighter than Kaminari](https://ddnexus.github.io/pagination-comparison/gems.html)!

In addition, Pagy is well explained with plenty of guides.

_Date of first release: February 12, 2018. It has gained 1 million+ downloads within two years._

---

## Code quality
### [Undercover](https://github.com/grodowski/undercover)
Its creators state that Undercover is “**Like RuboCop but for code coverage.**” It detects recently changed code blocks that have to be covered with tests. Undercover can be used both locally and in an automated build.

Undercover is not super popular, though it is quite a helpful library, especially for big projects with legacy code.

_Date of first release: May 10, 2018. For the first two years, it had just 68k+ downloads._

---

## Developer tools
### [Rexe](https://github.com/keithrbennett/rexe)
The **command line executor** is designed to simplify your Ruby command line by removing low-level configuration parsing and formatting.

Rexe helps efficiently merge shell scripting and Ruby on the same command line.

It is a small script with a number of applications, some of which are pretty funny. For example, you can use it as a simple calculator or a currency converter 🙂

_Date of first release: February 3, 2019. For the first 1.5 years, Rexe was downloaded 8k times._


### [Optimist](https://github.com/ManageIQ/optimist)
Optimist is a **command-line option parser** that does the parsing and then provides you with a hash table of options. It helps you to save time and write less code. It also automatically generates help pages. On their wiki, you will find a few examples of the commands use and short options generation.

In the end, we like the name! And we are not alone here – the gem is very popular.

_Date of first release: August 24, 2018. For the first 1.5 years, Optimist gained 8 million+ downloads._


### [Quarantine](https://github.com/flexport/quarantine)
Quarantine **manages flaky tests by detecting and disabling them**. It also helps automate testing workflows. Quarantine is compatible with the Rspec framework and Buildkite CI pipeline.

You can also set up a Jira workflow to get automatically created tickets in Jira for flaky tests. Once the ticket is closed, the test is removed from quarantine.

_Date of first release: April 22, 2019. Within a year, Quarantine was downloaded 175k+ times._

---

## Graphics
### [Apexcharts](https://github.com/styd/apexcharts.rb)
Apexcharts is a **library for creating amazing web charts in your Ruby app**. It’s just beautiful: you will find numerous examples of completely different types of charts.

To build the data for a chart, it is recommended to use [groupdate](https://github.com/ankane/groupdate) gem.

_Date of first release: June 13, 2019. In a year, this gem got 14k downloads._

---

## Encryption
### [Lockbox](https://github.com/ankane/lockbox)
The Lockbox gem is a **modern and user-friendly way to encrypt your data**.

It is secure, simple, and compatible with other libraries. Another argument for trying it is that it is easy to migrate to Lockbox from another library.

Lockbox works perfectly with Devise, which is the most popular authentication framework for Rails.

We have recently posted the experience of our friends from Planet Argon with setting up emails to **reset a password with Devise** (and Mailtrap, of course!) – [check this blog post for more info](https://mailtrap.io/blog/devise-reset-password/).

_Date of first release: January 2, 2019. Within 1.5 years, Lockbox was downloaded 127k times._

---

## Machine learning
### [TensorStream](https://github.com/jedld/tensor_stream)
Do you use machine learning algorithms? Then consider the **TensorFlow implementation for Ruby**. It is not new, but we found it worth sharing here.

TensorStream is an open-source framework with no TensorFlow dependencies. With its programming style close to TensorFlow and Ruby syntax, you can build and run machine learning models in GPUs and CPUs. It comes with a pure Ruby and OpenCL opcode evaluator. An OpenCL backend is provided in a [separate gem](https://github.com/jedld/tensor_stream-opencl).

_Date of first release: May 11, 2018, and 12k+ downloads over 2 years._

---

## Monitoring
### [Yabeda](https://github.com/yabeda-rb/yabeda)
This Ruby gem is a framework for **setting up monitoring in your Ruby app**. Yabeda collects statistics on your app performance and allows you to export metrics to several monitoring systems.

In addition, there are many plugins for Yabeda to configure monitoring with ease.

_Date of first release: October 17, 2018. Over roughly 1.5 years it was downloaded 128k+ times._

---

## Deployment
### [Tomo](https://github.com/mattbrictson/tomo)
Tomo is an **SSH-based CLI tool for deploying Ruby apps**. Its distinguishing feature is its independence from Rake, unlike the majority of Ruby-based deployment tools. Tomo is presented as an alternative to Capistrano, Shipit, and Mina.

It has no required gems dependencies, but batteries are included, as well as opinionated defaults and simple DSL.

_Date of first release: June 17, 2019. For less than a year, Tomo was downloaded 11k+ times._

---

## Testing
### [FakerMaker](https://github.com/billyruffian/faker_maker)
FakerMaker is a **simple factory builder that creates disposable objects for testing**. It is created to supplement the [Thoughtbot](https://github.com/thoughtbot/factory_bot) library for cases when you test an API, don’t use Rails, or don’t have model classes.

It is recommended to use FakerMaker with a [Faker](https://github.com/faker-ruby/faker) gem (no dependency, though).

_Date of first release: March 5, 2019. In slightly more than a year, this gem got 19k+ downloads._

---

## Web apps, services, and interaction
### [Cache Crispies](https://github.com/codenoble/cache-crispies)
Cache Crispies is a gem for **JSON serialization** that has a built-in caching. It doesn’t limit you with the format of JSON responses. It’s fast and flexible and has a simple DSL.

_Date of first release: July 12, 2019. 50k+ downloads were reached in less than a year._

---

## Wrapping up
Let me know what you think about this list by sharing it and your experience!

And Mailtrap is always here for safe and efficient testing of any kind of email you need to send from your Ruby app. In fact, Mailtrap is technology agnostic – that’s why there is no Ruby gem for it. You can easily configure Mailtrap as a regular SMTP server or integrate it with your app via API and enjoy email testing, previewing, and debugging in a development or staging environment.

---

_As always, thanks for reading! Visit the original article and much more helpful guides and blogs on [mailtrap.io](https://mailtrap.io/blog/ruby-gems/) 🔎💻_