SublimeLinter-Rubocop does not work even when enabled and rubocop in the path

I am trying to get Rubocop warnings to display as code in Sublime Text 3. I am using SublimeLinter and SublimeLinter-rubocop . (A similar RuboCop package works, but doesn't seem to support code marking.)

RuboCop installs and starts from the rbenv pad folder:

 $ rubocop response_test.rb ... 1 file inspected, 11 offenses detected 

SublimeLinter uses rbenv pads:

 SublimeLinter: computed PATH using /bin/bash: /Users/andrew/.rbenv/shims /usr/local/bin /usr/bin /bin /usr/sbin /sbin 

Extension included:

 ... "linters": { "rubocop": { "@disable": false, "args": [], "excludes": [] }, ... } ... 

But warnings are not displayed, and linter does not even start:

 reloading settings Packages/User/SublimeLinter.sublime-settings SublimeLinter: ruby: response_test.rb ['/usr/bin/ruby', '-wc'] SublimeLinter: ruby output: Syntax OK 

Is there anything that could explain this? I am new to Rubocop and Sublime Text, so I may have missed something basic.

+5
source share
1 answer

I recently had the same issue, and I fixed it just now. You probably already understood this, but here is my solution.

I believe the problem is that your sublime search in the original ruby โ€‹โ€‹path of the system /usr/bin/ruby' .

You must

First, specify the correct path for ruby โ€‹โ€‹env (rbenv in my case) in Packages/User/SublimeLinter.sublime-settings as follows:

 { ... "paths": { "linux": [], "osx": [ "~/.rbenv/shims/" ], "windows": [] }, ... } 

After that, it rises completely and opens again.

Hope this helps.

0
source

Source: https://habr.com/ru/post/1263078/


All Articles