Integrate Rubocop gem with Popular Ruby Text Editors

Rubocop gem with Popular Ruby

RuboCop is a very popular gem among ruby developers for the static code analysis of the ruby codebase. It does static code analysis as per ruby style guide. If you are a beginner in Ruby and Rails, it is highly recommended to use this gem as it will help you a lot to improve your coding skills.

The first thing you need to do is installing the rubocop gem.

$ gem install rubocop

You can always fire rubocop shell command from base directory of your source code to start code analysis but how about your favourite text editors help you to display all the styles which you are violating as you write the code? Seems cool right? So lets integrate RuboCop to few popular text editors.

Benefits of integration

Let start adding this to our favorite code editors.

  1. Sublime
Sublime Text Official Logo

Sublime RuboCop is a Sublime Text plugin that runs RuboCop on your ruby files. The main benefit of this integration is it will give you the errors as soon as you open/save any ruby(.rb) file.

NOTE: Make sure you have installed Package Control in your sublime.

You can integrate this gem to your sublime text by following steps –

$ cd ~/.config/sublime-text-3
$ cd Packages
$ git clone git@github.com:pderichs/sublime_rubocop.git "RuboCop"

Now as and when you open/save any ruby file, this plugin will analyze the ruby code and will show you errors if any. The part of code having errors will be underlined red and when you move the cursor to that line the error message will be displayed in the status bar of sublime. See below

Here you can see following errors/suggestions in this ruby file

Integration of this gem with sublime increases readability of code and makes it more efficient.

2. Atom

Atom Editor Official Logo

Integrating RuboCop to your Atom text editor is very easy. Follow the steps as mentioned below

After the successful installation of the package, when you open/save any file the errors will be displayed in the footer pane.

3. Visual Studio Code

Visual Studio Code Official Logo

Integration RuboCop with Visual Studio Code is again very simple! Follow below steps

Ruby Rubocop extension for Visual Studio Code

After successful installation the ruby-rubocop, editor will highlight the error code with wavy underline(green color in below theme), when you take the mouse cursor to that code it will show you suggestions/corrections in your code.

4. Vim

Vim Editor Logo

This is super easy in Vim editor with RuboCop Vim plugin.

Suggestions by RuboCop for Vim Editor

Thanks Piarulli Pierre-Alex for response. Now I have added RuboCop integration to Vim editor as per you recommendation 🙂

5. RubyMine

RubyMine Editor Logo

Just follow the steps mentioned in https://github.com/sirlantis/rubocop-for-rubymine#installation.


At BoTree Technologies, we build web and mobile applications to add value to our client’s business. We align ourselves to ensure that our client benefits the most out of our engagement.

We work in Ruby on RailsPython, Java, React, Android, iOS and RPA as well.

Drop us a line to discuss how can we help take your business to the next level.

Related posts

Django  Framework - Multiple files upload on AWS with Different Content Types

byNipun Brahmbhatt
6 years ago

Benefits of Python Web Programming for Data Science

byYogendra Katewa
4 years ago

Using HashWithIndifferentAccess to access similar looking string and symbolic keys

byMittal Patel
5 years ago
Exit mobile version