I have install rubocop as for my linter and auto-beautify via atom-beautify in settings. However, when I run the command, "ctrl-alt-b", it returns the error that it cannot find 'rubocop'.
But linter-rubocop can find rubocop fine and work properly. I have it under rbenv.
Link:
https://gist.github.com/reidcooper/1cc6d16bf06cc8686d0c
Please follow contribution guides at https://github.com/Glavin001/atom-beautify/blob/master/CONTRIBUTING.md
Specifically the Gist named debug.md with the results of the Atom Beautify: Help Debug Editor.
I updated my original post.
Thanks,, I'll take a look.
For reference, here is the applicable code in linter-rubocop: https://github.com/AtomLinter/linter-rubocop/blob/master/index.coffee
@reidcooper Atom Beatify uses your PATH environment variable to detect the location of executables.
This is what Atom Beautify detects your PATH environment variable to be:
PATH=/Users/reidcooper/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin
Could you confirm this by going into your Terminal and running echo $PATH?
Also what is the path to your rubocop executable? Running which rubocop will return this in your Terminal.
echo $PATH
/Users/reidcooper/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin
which rubocop
rubocop not found
If I type:
rbenv which rubocop
then I get:
/Users/reidcooper/.rbenv/versions/2.2.2/bin/rubocop
I am using linter-rubocop and according to their documentation, it said, if you are using rbenv to type in:
rbenv which rubocop
So you have manually set the executablePath for linter-rubocop then? If yes, then this indicates that your statement:
But linter-rubocop can find rubocop fine and work properly.
was incorrect. linter-rubocop was not able to find rubocop and instead you manually set it.
You can get Atom Beautify to work by adding /Users/reidcooper/.rbenv/versions/2.2.2/bin/ to your PATH environment variable.
I executed
export PATH=$PATH:/Users/reidcooper/.rbenv/versions/2.2.2/bin
to add to my path, and I restarted Atom. However, I still received the same error. Am I forgetting something? Also, I am using z-shell if that matters.
Edit: I think I got it to work. I had to add to my zshell profile instead of the bash profile.
Edit: I think I got it to work. I had to add to my zshell profile instead of the bash profile.
Right on. Glad to here it is working now.
I hope to make this process easier in the future.
I have also been working on this problem. Just fixed it - the gem is missing:
gem install rubocop
Solved it by looking at linter-rubocop.
Might I suggest adding this to the documentation. I didn't realize there was a linter for ruby.
https://www.ruby-toolbox.com/projects/rubocop
I'm still experiencing this issue even after having tried the solutions listed above. Would it be possible to add an option at the end to specify the path of Rubocop?
@emanuelet : I would accept a Pull Request. Applicable code can be found at https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/rubocop.coffee
opened PR #676
update settings as in following:
I really want to focus on improving the installation experience for users. I have created a new Issue, #1687, to target this problem. Please provide your feedback! Thanks in advance.
@aashish Image is missing ...
@goxr3plus Sorry for that. Please follow the instructions
$ which rubocop
/home/xxxxxx/.rvm/gems/ruby-2.3.1@xxxxxxxx/bin/rubocop
Update Rubocop Path as
/home/xxxxxx/.rvm/gems/ruby-2.3.1@xxxxxxxx/bin/rubocop
I did ''' gem install robucop ''' and problem was solved :)
Στις 25 Δεκ 2017 16:57, ο χρήστης "Aashish Kiran" notifications@github.com
έγραψε:
@goxr3plus https://github.com/goxr3plus Sorry for that. Please follow
the instructions$ which rubocop
/home/xxxxxx/.rvm/gems/ruby-2.3.1@xxxxxxxx/bin/rubocopUpdate Rubocop Path as
/home/xxxxxx/.rvm/gems/ruby-2.3.1@xxxxxxxx/bin/rubocop—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Glavin001/atom-beautify/issues/548#issuecomment-353874312,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATbiwIHvhCizbsEtAEetSBEpyrZ22E0nks5tD7frgaJpZM4F86as
.
@goxr3plus great!! robocop is being detected.
For anyone that the above doesn't work for. If you have installed the gem and still getting errors, try using the RVM wrappers, solved it for me.
/Users/xxxxx/.rvm/gems/ruby-2.3.7@xxxxx/wrappers/rubocop
Most helpful comment
I have also been working on this problem. Just fixed it - the gem is missing:
gem install rubocop
Solved it by looking at linter-rubocop.
Might I suggest adding this to the documentation. I didn't realize there was a linter for ruby.
https://www.ruby-toolbox.com/projects/rubocop