Rubocop in Sublime Text 3 with rbenv

Quick guide to have your ruby environment set up in Sublime Text 3 with rubocop and rbenv. It was quite tricky for me at first. Hope it helps.

Image result for rubocop

Install the Rubocop package

Open the Package Installer using the cmd+P dialog:

Search for the RuboCop package and install it:

Go to Sublime Text > Preferences > Pkg Settings > Rubocop > User Settings:

And add the following:

“mark_issues_in_view”: true,
“check_for_rvm”: false,
“check_for_rbenv”: true,
“show_auto_correct_warning”: false,
“rbenv_path”: “/usr/local/Cellar/rbenv/1.1.1/bin/rbenv”,

Try it out

Now, if you open a ruby file, you should see something like:

Note that you have several RuboCop commands available via cmd+P:

To get more detailed explanations, use check current file:

Or you could also use the package built-in auto-correct feature:

But note that it is not actually able to fix everything for you:

So pay attention. Now, go there and fix it!

Niiice (っ◔◡◔)っ ♥

Are you into productivity hot tips for web development? I’m a Brazilian full-stack developer, living and working in Paris, and I regularly share articles like the one you’ve just read. Follow me on twitter to stay tuned.

Brazilian full-stack developer. Living and working in Paris. Sharing productivity hot tips for web development.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store