So, what exactly is a gem?
Shortly: it is a plug-in. An additional functionality added to the main product to fulfil specific needs.
And how to install gem?
Easily. Of course, on top of that you must install Ruby itself, but as you're still reading my words I assume you know what the fuss is all about.
Find the gem that interests you and add it to the Gemfile. Make sure to install the latest stable release:
`gem install GEM_NAME`
Now, install via bundler. The bundler itself is also a gem, so the command will look like this:
`gem install bundler'
Using bundler allows other developers to work on your app with the same version of every gem.
Now you can install gems using this:
Then, restart the server and apply the changes.
What Ruby Gems do we use?
Below you can find list of Best Ruby Gems for harder, better, faster, stronger web development our devs use from time to time.
The official Airbrake library for Ruby on Rails. Airbrake combes through your code, tracks bugs, captures errors and aggregates the results for developer review.
gem 'annotate', '~> 2.6.6'
Annotates Rails and ActiveRecord models as a gem. Keeps track of your database models and attributes, by adding schema information in your model file.
Great Ruby debugging companion: supports Ruby objects with colored output and visualizes their structure in an easy-to-read way.
Continuation of CanCan, the authorization Gem for Ruby on Rails. It lets you define permissions for given context. All permissions are stored in a single location.
Very useful gem that helps you to add file uploads to your Ruby application. Integrates image uploads with your model and stores them on different backends. It also allows you to convert video files with streamio-ffmpeg
Here you'll find some tips how to convert video files with CarrierWave.
Flexible and popular authentication solution for Rails applications. It prepares all the requirements in the code that are needed to create accounts, login or logout a newly created user.
A library that makes loading environment much easier. It loads environment-specific settings into environment variables. In Rails applications dotnev automatically loads environment variables from
.envto ENV .
Friendly gem for creating user friendly URLs.
Friendly_id that makes your model ids in your URL readable to human by generating a URL slug.
Gem that looks after the beauty of your code: by eliminating the repetitive tags of HTML and integrating conditional logic Haml-rails makes it easier to read.
Kaminari provides clear implementation of pagination by using scope called page with Active Record queries.
Rails i18n web interface. Proud to say, Lit is our homemade product, carefully prepared by our developers.
Translate your apps with pleasure (sort of...) and for free. It's simple i18n web interface, build on top of twitter bootstrap, that one may find helpful in translating app by non-technicals.
Since 2014, when we open sourced Lit on GitHub, it has been downloaded over 26,000 times and still counting. We have also used the gem as a feature of most web apps we have developed over the years. Five years is long enough to gather feedback from our customers and the GitHub community, and spot the areas for improvement. This is how we created the new, better Lit web interface for translating your apps.
Among the very highlights of Lit 1.0 are: automatic cloud translation (using Google Cloud Translate or Yandex), the 'deleted and visited again' tab, enabling you to restore a once-deleted translation key whenever it's called again by the console, the automatic 'translated' status, as well as import from and export of the keys to .csv files.
This is a Rails gem that manage multiple nested models in a single form. It does so in an unobtrusive way through jQuery or Prototype.
Installing Quiet Assets will automatically suppress the log messages and turn off the Rails asset pipeline log.
Ransack provides excellent help in building complex search forms. It has some really powerful features available such as sorting or conditional search.
A pack of responders modules to dry up your Rails 4.2+ app. Set contains responders like FlashResponder, HttpCacheResponder, CollectionResponder and LocationResponder.
Sidekiq is a full-featured background processing framework for Ruby. It aims to be simple to integrate with any modern Rails application and much higher performance than other existing solutions.
Gem that generate forms with many options to customize generated markup. Simply.
Transitions is an easy to use library, the state machine extracted from ActiveModel so it requires it's compliance.
Found this one interesting? Don't miss the second part of our best Ruby gems guide!
Know, seen, use, dream of other superb ruby gems worth mentioning? Give us a shot and leave a comment!
Oh, and by the way: have you seen our Free Ruby Tutorial: "Create your own SaaS app in Rails"?