40 Best Ruby Gems We Can't Live Without. Part 1
Tags: ruby, showdev, devtips, webdev
Published: 2019-05-29 06:57:41

---
title: 40 Best Ruby Gems We Can't Live Without. Part 1
published: true
description: Ruby gems are libraries, offering ready solutions for almost any functionality. Check the list of most useful Ruby gems which help our development team every day.
tags: ruby, showdev, devtips, webdev
canonical_url: https://www.codica.com/blog/top-ruby-gems-we-cant-live-without/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/j1c6i8d9lv7ph14rnb5g.jpg
---

Nowadays, web developers are able to access ready-made solutions instead of writing the functions from scratch, which of course has a great positive impact on the speed of development.

When we look at Ruby from this point of view, it stands out due to extensive libraries called Ruby gems. They offer particular functionalities to Ruby applications you build up. Suppose you want to have an authentication function in your program - you don't need to write one, you can get it in the form of a gem. And this is only one example among thousands of Ruby gems available for free.

In the first part of the [article](https://www.codica.com/blog/top-ruby-gems-we-cant-live-without/), we are going to uncover top Ruby gems we use in the following [web development](https://www.codica.com/services) spheres: **code quality, debugging, testing, deployment, and authentication & authorization**.
## Top Ruby gems that we use
Either we build an [MVP for a startup](https://www.codica.com/blog/why-build-startup-with-ruby-on-rails) or refactor a [multidomain financial analytics platform](https://www.codica.com/case-studies/finance-analytics-platform) codebase, Ruby gems stand for the main development tool.

In this article, we have prepared a list of Ruby gems. Actually, it is only a small part of all the gems that help us create quality products.
### Code quality
In order to remove bulky code blocks and handle the refactoring properly, we use the following Ruby gems.

[Rubocop](https://github.com/rubocop-hq/rubocop) is a gem for analyzing and formatting Ruby static code. RuboCop is extremely flexible and most aspects of its behaviour can be tweaked via various configuration options. 

[Overcommit](https://github.com/brigade/overcommit) is a tool for configuring Git hooks. It is excellent for keeping the code quality high. It allows tuning git hooks for linters launch before every commit.
### Debugging
Actually, even a high-quality project definitely throws errors and bugs. For this reason, our development team uses the following Ruby gems for debugging.

[Better_errors](https://github.com/BetterErrors/better_errors) is a gem to show errors. It shows useful data about an error and has an excellent visual impact. Better_errors replaces the standard Rails error page. 

[Byebug](https://github.com/deivid-rodriguez/byebug) is an easy-to-use and feature-rich debugger for Ruby. This gem allows line-by-line fulfilling of code, pausing between tasks and executing code, changing the variables on the move.
### Testing
In general, any development process is impossible without quality assurance of the application. In such cases, we come to testing, which allows you to assess the quality. To start and control tests conveniently and smoothly, our team uses the following gems.

[RSpec](https://github.com/rspec/rspec) stands for Behaviour Driven Development for Ruby. It provides more readable DSL, as compared to the TestUnit standard testing library. Moreover, it smoothly cooperates and integrates with other gems that help test your application.

You may find interesting our [GitHub repo](https://github.com/codica2/rspec-best-practices) on RSpec best practices.

[Capybara](https://github.com/teamcapybara/capybara) is an acceptance test framework for web applications. It perfectly cooperates with RSpec for testing purposes. The tool is responsible for integrated tests that imitate users’ actions in a browser. It allows describing the authorization scenario in a few lines, suggesting then various convenient methods for tests debugging.

[Capybara Screenshot](https://github.com/mattheworiordan/capybara-screenshot) is a gem for automatic saving of screenshots if a Capybara scenario breaks down. Together with Capybara and Cucumber, RSpec or Minitest, the gem allows view the source code and takes a screenshot (when relevant) for each failure in a test suite. 

[Parallel_tests](https://github.com/grosser/parallel_tests) makes tests written in TestUnit, RSpec and Cucumber pass faster running them in parallel on multiple CPUs. 

[Simplecov](https://github.com/colszowka/simplecov) is one of the most useful gems for testing. It provides you with the percentage of code covered with unit-tests. Thus, the gem encourages developers to write fully-tested code.

[Database Cleaner](https://github.com/DatabaseCleaner/database_cleaner) provides code coverage for Ruby 1.9+ with a powerful configuration library and automatic merging of coverage across test suites.

[RSpec::Retry](https://github.com/NoRedInk/rspec-retry) is a tool that provides :retry randomly failing RSpec example. It adds a :retry option for occasionally failing RSpec patterns. 
### Deployment
Deployment is an important stage of web development, and there’s one library that helps us run the process smoothly.

[Mina](https://github.com/mina-deploy/mina) is a fast deployer and server automation tool. In comparison with [Capistrano](https://github.com/capistrano/capistrano), Mina works much faster. It produces an entire procedure as a Bash script and runs it distantly on the server. 

Alongside, our development team has created our own tool for Mina, called mina-multideploy. It provides you with an opportunity to deploy applications on several servers in parallel.

Check our GitHub repository on [Mina Multi-deploy](https://github.com/codica2/mina-multideploy) for more information.

### Authentication and Authorization
Nowadays, almost all of the web applications require an authentication and authorization system. Thus, in order to implement the best user data protection, we use the following gems:

**[Devise](https://github.com/plataformatec/devise)** is a flexible authentication solution for Rails based on Warden. Devise provides you with any complexity level - from authentication via email and password to a referral system. In a few words, it has 10 modules, including:

* [Confirmable](https://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Confirmable): sends emails with confirmation instructions and verifies whether an account is already confirmed during sign in;
* [Recoverable](https://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Recoverable): resets the user password and sends reset instructions;
* [Rememberable](https://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Rememberable): manages token generation and clearing to remember the user from a saved cookie;
* [Trackable](https://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Trackable): tracks sign-in account, timestamps and IP address.

[Ruby-JWT](https://github.com/jwt/ruby-jwt) gem is a simple Ruby implementation of the [RFC 7519 OAuth JSON Web Token (JWT)](https://tools.ietf.org/html/rfc7519) standard. It stands for one of the safest information transfer systems between two parties.

For practical application of this gem, check our [blog article](https://www.codica.com/blog/time-tracking-with-slack-bot) where we specify how we implemented JWT when creating a Time Bot for Slack.

![](https://thepracticaldev.s3.amazonaws.com/i/9kexnjdoevn9f9w38pqk.jpg)

In this scheme, an application server is configured to check whether an incoming JWT is the one generated with the authentication server.

## Final words

In this chapter, we have provided you with various Ruby gems that we implement in different development spheres. They all help us to keep the code quality on a high level, simplify the debugging and testing processes, accelerate and enhance our applications’ deployment, and, finally, secure the users’ data. 

We believe this chapter will be useful for you and your development team (if any). In the next chapter, we will tell you what Ruby gems are used at Codica for the following development aspects: **uploading files, search, admin panels, and more awesome gems for different tasks**.

Stay tuned and read the full article version here: [40 Best Ruby Gems That We Use](https://www.codica.com/blog/top-ruby-gems-we-cant-live-without/).