Atom-beautify: Could not find 'rubocop'. The program may not be installed

Created on 28 Jan 2019  Â·  3Comments  Â·  Source: Glavin001/atom-beautify

Description

The results of beautification are not what I expect.

I'm work with rbenv and I did gem install robucop and it did not work.

GIST

Input Before Beautification

This is what the code looked like before:

class BookInStock
def initialize(isbn, price)
@isbn = isbn
@price = Float(price)
end
def to_s
"ISBN: #{@isbn}, price: #{@price}"
end
end

Expected Output

The beautified code should have looked like this:

class BookInStock
  def initialize(isbn, price)
    @isbn = isbn
    @price = Float(price)
  end

  def to_s
    "ISBN: #{@isbn}, price: #{@price}"
  end
end

Actual Output

The beautified code actually looked like this:
screenshot from 2019-01-28 12-38-13
Could not find 'rubocop'. The program may not be installed.

Steps to Reproduce

  1. Add code to Atom editor
  2. Run command Atom Beautify: Beautify Editor
  3. This beautified code does not look right!

Debug

Here is a link to the debug.md Gist:
GIST

Checklist

I have:

  • [ ] Tried uninstalling and reinstalling Atom Beautify to ensure it installed properly
  • [ ] Reloaded (or restarted) Atom to ensure it is not a caching issue
  • [x] Searched through existing Atom Beautify Issues at https://github.com/Glavin001/atom-beautify/issues
    so I know this is not a duplicate issue
  • [ ] Filled out the Input, Expected, and Actual sections above or have edited/removed them in a way that fully describes the issue.
  • [x] Generated debugging information by executing Atom Beautify: Help Debug Editor command in Atom and added link for debug.md Gist to this issue
stale

Most helpful comment

A SOLUTION:

xcode-select --install
Then try running
gem install rubocop

All 3 comments

having the same issue. When I try and run
gem install rubocop

I get the following:

// ♥ gem install rubocop
Building native extensions. This could take a while...
ERROR:  Error installing rubocop:
    ERROR: Failed to build gem native extension.

    current directory: /Users/rogerperez/.rvm/gems/ruby-2.5.3/gems/jaro_winkler-1.5.2/ext/jaro_winkler
/Users/rogerperez/.rvm/rubies/ruby-2.5.3/bin/ruby -r ./siteconf20190201-95719-di5gax.rb extconf.rb
creating Makefile

current directory: /Users/rogerperez/.rvm/gems/ruby-2.5.3/gems/jaro_winkler-1.5.2/ext/jaro_winkler
make "DESTDIR=" clean
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

current directory: /Users/rogerperez/.rvm/gems/ruby-2.5.3/gems/jaro_winkler-1.5.2/ext/jaro_winkler
make "DESTDIR="
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

make failed, exit code 1

Gem files will remain installed in /Users/rogerperez/.rvm/gems/ruby-2.5.3/gems/jaro_winkler-1.5.2 for inspection.
Results logged to /Users/rogerperez/.rvm/gems/ruby-2.5.3/extensions/x86_64-darwin-17/2.5.0/jaro_winkler-1.5.2/gem_make.out

A SOLUTION:

xcode-select --install
Then try running
gem install rubocop

This issue has been automatically marked as stale because it has not had recent activity. If this is still an issue, please add a comment. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maximsch2 picture maximsch2  Â·  5Comments

physcocode picture physcocode  Â·  3Comments

jcollum picture jcollum  Â·  4Comments

seanoldfield picture seanoldfield  Â·  5Comments

bartocc picture bartocc  Â·  5Comments