Glavin001 / atom-beautify

:mega: Help Wanted - Looking for Maintainer: https://github.com/Glavin001/atom-beautify/issues/2572 | :lipstick: Universal beautification package for Atom editor (:warning: Currently migrating to https://github.com/Unibeautify/ and have very limited bandwidth for Atom-Beautify Issues. Thank you for your patience and understanding :heart: )
http://unibeautify.com/
MIT License
1.5k stars 453 forks source link

Could not find 'rubocop'. The program may not be installed. #2381

Open mullermp opened 4 years ago

mullermp commented 4 years ago

Description

When trying to run atom-beautify using rubocop, I get the following error

Full error message:

See rubocop installation instructions at https://github.com/Glavin001/atom-beautify#beautifiers or go to http://rubocop.readthedocs.io/en/latest/installation/
You can configure Atom Beautify with the absolute path to 'rubocop' by setting 'Executable - Rubocop - Path' in the Atom Beautify package settings.
Your program is properly installed if running 'which rubocop' in your Terminal returns an absolute path to the executable.

I am using chruby: https://github.com/postmodern/chruby with ruby version 2.6.3 and rubocop 0.74.0.

Environment output:

mamuller@4c327598178f:~/workplace/aws-sdk-ruby$ which rubocop
/Users/mamuller/.gem/ruby/2.6.3/bin/rubocop

mamuller@4c327598178f:~/workplace/aws-sdk-ruby$ rubocop -v
0.74.0

mamuller@4c327598178f:~/workplace/aws-sdk-ruby$ chruby-exec ruby -- rubocop -v
0.74.0
Saving session...
...copying shared history...
...saving history...
...completed.

mamuller@4c327598178f:~/workplace/aws-sdk-ruby$ cat ~/.ruby-version 
ruby-2.6.3

mamuller@4c327598178f:~/workplace/aws-sdk-ruby$ echo $PATH
/Users/mamuller/.toolbox/bin:/Users/mamuller/.gem/ruby/2.6.3/bin:/Users/mamuller/.rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/bin:/Users/mamuller/.rubies/ruby-2.6.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Wireshark.app/Contents/MacOS

mamuller@4c327598178f:~/workplace/aws-sdk-ruby$ cat ~/.bash_profile | grep chruby
# https://github.com/postmodern/chruby
source /usr/local/share/chruby/chruby.sh
source /usr/local/share/chruby/auto.sh

Atom process.env output has path as:

"/Users/mamuller/.toolbox/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Wireshark.app/Contents/MacOS:/Users/mamuller/.toolbox/bin"

with no GEM_HOME/GEM_PATH/GEM_ROOT set.

When running Atom via CLI, process.env reports the path to be:

"/Users/mamuller/.toolbox/bin:/Users/mamuller/.gem/ruby/2.6.3/bin:/Users/mamuller/.rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/bin:/Users/mamuller/.rubies/ruby-2.6.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Wireshark.app/Contents/MacOS"

as well as GEM_HOME/GEM_PATH/GEM_ROOT being set correct.

The linter-rubocop plugin works correctly (started by CLI or by Mac dock) using the command:

/usr/local/bin/chruby-exec ruby -- rubocop

Input Before Beautification / # Expected Output / # Actual Output

These sections do not apply.

Steps to Reproduce

  1. Start Atom using CLI or Mac dock
  2. Add code to Atom editor
  3. Run command Atom Beautify: Beautify Editor
  4. Rubocop could not be found

Debug

Here is a link to the debug.md Gist: https://gist.github.com/mullermp/a65a2ad60624cbe1e5ccdf96f9b6e185

Checklist

I have:

mullermp commented 4 years ago

Bump!