Ruby on Rails is one of the most popular frameworks used on the web. It is flexible, open-source, free and good for fast coding. What is more, there is a big community ready to help and share knowledge. Developers all over the world contribute to the framework making it richer and more popular. As a result, the framework can boast of a big number of useful gems that help to solve different practical problems. Do you intend to have an easy REST framework? Is it required to set up a web server? Send emails? Gems will help with even more tasks.
There is no need to reinvent the wheel and spend hours trying to figure out what to do next. The ready plugin can be used inside your project simplifying many things. Just install and use. Let’s see what gems do a really good job and can be regarded as a must for most Ruby projects.
Let’s see what Ruby gems have proved to be great solutions and should be considered in the first place.
One of the most popular Ruby gems. It is an authentication solution. The gem provides such options as login, registration, forget password, account locks, email validation and more.
Devise is recommended for developers who have a good command of Rails. Beginners should better start with an authentication system from scratch.
It’s from the same league as Devise is. However, Pundit is responsible for authorization (limiting resources a user is able to get access to). The gem covers the whole process by defining authorization systems using Ruby classes.
A useful gem for BDD testing. It is one of the oldest gems: RSpec was created as an experiment in 2005. Now hundreds of developers contribute to the library improving it.
It is a simple and flexible gem that allows to upload files from Ruby applications. CarrrierWave is used in Ruby on Rails, Sinatra and other Ruby frameworks.
Sidekiq is one of the most popular background processors. It has simple API and good scalability.
It is a static code analyzer based on the community-driven Ruby Style Guide. It is able to both report code problems and fix some of them.
It is a useful gem that checks Ruby classes, methods and modules. If the code seems to be “smelly” Reek lets you know.
The gem allows you to make decorators around models so there is no need to write helpers. Decorators wrap original models and present a list of necessary methods and attributes for your object.
Fast tool for deployment and server automation. It has only one SSH connection per deploy which allows to achieve faster results.
One of the most popular Ruby gems. Kaminari is a clean and powerful paginator that helps to paginate anything from ActiveRecord relations to simple arrays.
The gem defines attributes for modules, classes and class instances with optional information about types. It can be used to encapsulate data access in Value Objects, to map JSON to domain objects and more.
The gem runs a simple SMTP server that receives any message sent to it and shows it in a web interface.
The tool is used for debugging. The gem makes rails console open pry, an alternative to the standard shell for Ruby.
There are numerous useful Ruby gems on the web. Each one aims at accomplishing particular tasks. Use good gems and enjoy comfortable coding!