Closed robwise closed 9 years ago
The plugin runs ruby
not rubocop
. I'm not familiar enough with rbenv to know if that matters.
@reconbot I edited my post to ensure I don't spread misinformation.
After reading your comment, I became even more suspicious that it was a PATH problem due to some weird issue with rbenv and ZSH. It seems ST3 was using/detecting my shell as Bash instead of ZSH, and therefore was not loading my specified PATHs. The SublimeLinter documentation seems to indicate that it should be able to tell that I use ZSH, but it seems that isn't the case.
This should have been overcome anyway by manually specifying the path to Ruby in the paths
section of the SublimeLinter settings in ST3. However, like an idiot, I had specified the ~/.rbenv/shims/rubocop
directory instead of just ~/.rbenv/shims
as directed here in the troubleshooting guide.
Because you pointed out the plugin is running ruby and not rubocop anyway, I quickly found this error and everything is working fine! Thank you!
For future reference: if you're like me and are getting the console error:
SublimeLinter: rubocop version query: /Users/samh/.rbenv/shims/ruby -S rubocop –version
SublimeLinter: WARNING: no rubocop version could be extracted from:
ruby: no Ruby script found in input (LoadError)
This article will help: https://sunlightfoundation.com/2015/03/31/making-sublimelinter-work-with-rbenv-and-rubocop/
@dpikt thanks a lot, your guide was amaizing and let me to set up successfully my ubuntu linux + zsh + rbenv + sublimelinter + rubocop, thanks again!
I was wondering if I could get some help troubleshooting—I'm not getting any Rubocop linting to show up and I've exhausted the suggestions in the docs (or so I think).
ST3 debug mode printout when I open a
.rb
fileEnvironment
Steps Taken
As you can see, it seems to be looking for the rubocop gem inEdit: @reconbot has pointed out that I am misreading the error message, as the plugin is trying to run ruby, not the rubocop gem here./usr/bin/ruby
for some reason and then can't find it.This has happened only after I switched from using Bash to using ZSH. ST3 rubocop linting was working then, and the gem itself continues to work from the command line. In case it's helpful:
I have made sure that my path variables (including
~/.rbenv/shims
are set in~/zprofile
). I tried to troubleshoot by adding that path directly in my SublimeLinter user settings paths section as well.Also, as directed, I moved the weird
eval "(rbenv init - zsh)"
line to~/.zprofile
as well. Note that this includes thatzsh
part after the hyphen, which is not how it is in the docs, but ZSH yells at me if I don't put that in there (https://github.com/sstephenson/rbenv/issues/487).Relevant Paths section from ST3 debug console