As you work with your favorite programming language, you often look for tools to make your job easier. In the Ruby world, these tools (gems) are created on a daily basis, but only some of them are good enough to win our hearts.
Here are some of the core gems that have a special place in all of our Gemfiles. Some of them help with debugging code, others provide certain functionality like authentication. That's useful in almost any project. In the end, they all help us work faster and produce quality software.
Standard Rails error page offers valuable information, but it's static, so you can't check what actually went wrong - besides the stack trace. Better Errors, in combination with binding_of_caller, allows you to inspect source code live through a console that works on every stack frame. Rails 4.2 added something similar, but we've yet to see if it will manage to replace Better Errors.
Whether you need simple HTTP authentication, or you're looking for some complex Facebook and Google+ login system, this authentication solution is great and it will significantly speed up your work. It's built on top of the Rails MVC stack and its modular architecture allows you to pick what you need.
The successor of the abandoned cancan project, this authorization gem lets you define what a user can do on your website by using abilities defined in a single place.
user ||= User.new # guest user (not logged in)
can :manage, :all
can :read, :all
In newer projects we started experimenting with pundit. It is faster, more modular and it wont bloat a single file.
We find this gem to be the best when you need to extract some longer-running actions (e.g., sending newsletters to a large number of users) into a background task. You can reuse methods from your models, or you can create complex classes for all your background task needs. With delayed_job, even progress bars are possible in Ruby on Rails.
It's quite annoying to set up email delivery in a development environment, and that's where Letter Opener is great. It displays the email in your browser so you can easily inspect it, click any links (e.g., account confirmation) and not spam your email account with tons of test emails.
Easily configured, this gem allows you to do fast remote deployments of you website, as multiple environments are supported and all the work is done in only one SSH session (compared to Capistrano's multiple SSH sessions). For more info, check out this article about Mina, written by my colleague Gabrijel Škoro.
You often have to deal with attachments that need to be processed in various ways. With paperclip, that becomes quite simple (with the support of ImageMagick) and allows you all sorts of validations and transformations, providing support for customizations as well.
Plain Rails generated forms (and related helpers) aren't really that helpful when you're designing a great user interface, which is essential for every website. This is where Simple Form saves the day with its powerful yet simple DSL.
When testing your projects, you need data. The best way to generate test data is to use a factory generator. The factory_girl_rails gem helps you to easily integrate Factory Girl, our favorite factory generator, into your Rails projects.