FRETE GRÁTIS em compras acima de R$189
← Voltar

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 (っ◔◡◔)っ ♥