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 for authentication, Cancan for authorization, Kaminari for pagination, or run tests with 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 in 2021. All of them have been released within the last year or two, 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.
Active Record plugins
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!
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.
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.
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 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 milion+ downloads.
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.
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 gem.
Date of first release: June 13, 2019. In a year, this gem got 14k downloads.
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.
Date of first release: January 2, 2019. Within 1.5 years, Lockbox was downloaded 127k times.
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.
Date of first release: May 11, 2018, and 12k+ downloads over 2 years.
The name of this Ruby gem is translated from Russian as “snitch.” It 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.
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.
FakerMaker is a simple factory builder that creates disposable objects for testing. It is created to supplement the Thoughtbot 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 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 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.
We have gathered 12 Ruby gems that you probably haven’t discovered yet. Hopefully, they will make your Ruby coding smoother and more efficient. Let us know what you think about this list by share it and your experience on social media!
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.