10 Useful Ruby Gems
I like stuff that makes my life easier. In the Ruby world, there are gems that I’ll use time and time again. In this post I will list 10 gems that I find useful.
devise
This is an authentication solution that works right out of the box. It includes user sign up, login, and password retrieval. Aside from the standard authentication features, it also includes Omniauth support and other features.
bootstrap-sass
This gem adds the SASS version of Bootstrap to your asset pipeline. The reason this is so useful is because a lot of time is saved by not having to download and install the bootstrap assets yourself. They also allow you to leverage the convenient SASS variables.
carrierwave
This gem provides an easy to use API for managing file and image uploads. I choose carrierwave above other file upload gems because I have found it easier to integrate with third party image hosting services such as Cloudinary. It has also been easier to integrate with Amazon S3 from my experience.
active_model_serializers
The object oriented approach that this gem takes towards JSON API design has been much easier to work with than some of the other gems I’ve used. The syntax is much more readable and user friendly. The difference between this and other JSON gems is that I can tell exactly what’s going on without having to reference the documentation.
activeadmin
This gem has saved me a tremendous amount of time by providing a prebuilt admin CRUD interface that you can hook into any of your models. It also features CSV downloads of database tables by default. It works with devise and generates an admin user model for you as well.
figaro
It is best practice to store secret information like API keys and such in environment variables instead of checking them into your Git repository. Figaro provides a way for you to conveniently store all of that information in a yaml file. It even has a command to push your configuration to Heroku.
pry-rails
Pry is a debugging tool that allows you to set breakpoints in your Ruby code and “stop time” for you to inspect stuff. Pry-rails is pry plus the added benefit of improved formatting in the rails console.
delayed_job_active_record
It is best practice to put image processing, emailing, and other long running processes in background jobs. Delayed Job is the simplest one to get started with, and for that main reason I choose Delayed Job.
guard-livereload
This gem provides a way for you to automatically reload your browser every time you change a view or any other file you specify in your Guardfile. This may not seem like a huge deal, but not having to refresh the browser every time you want to see your view changes adds up.
puma
And finally there is Puma, a faster, production ready web server. Its simple to get this one set up. All you pretty much have to do is add it to your Gemfile and run bundle. I’ve made the mistake of using WEBrick in production on a highly trafficked microsite, something I never want to go through again.
Well there it is. 10 useful Ruby gems. Hopefully this will provide some ideas to consider on your next Rails project.