Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Rubocop can't be found #615

Closed
anhmiuhv opened this issue Apr 23, 2020 · 4 comments
Closed

Rubocop can't be found #615

anhmiuhv opened this issue Apr 23, 2020 · 4 comments
Labels

Comments

@anhmiuhv
Copy link

anhmiuhv commented Apr 23, 2020

Your environment

  • vscode-ruby version: 0.27.0
  • Ruby version: 2.4.2
  • Ruby version manager (if any): rvm
  • VS Code version: 1.44.2
  • Operating System: MacOS
  • Using language server? (eg useLanguageServer is true in your configuration?): yes
  • shell: zsh

Expected behavior

I install rubocop. language server should be able to use it.
Use rubocop on the intergrated terminal works ok.

cat /Users/linhhoang/Documents/gatech/humtum/sc-platform/app/controllers/users_controller.rb | bundle exec rubocop -s /Users/linhhoang/Documents/gatech/humtum/sc-platform/app/controllers/users_controller.rb -f json


{"metadata":{"rubocop_version":"0.82.0","ruby_engine":"ruby","ruby_version":"2.4.2","ruby_patchlevel":"198","ruby_platform":"x86_64-darwin19"},"files":[{"path":"app/controllers/users_controller.rb","offenses":[{"severity":"convention","message":"Add an empty line after magic comments.","cop_name":"Layout/EmptyLineAfterMagicComment","corrected":false,"correctable":true,"location":{"start_line":2,"start_column":1,"last_line":2,"last_column":1,"length":1,"line":2,"column":1}},{"severity":"convention","message":"Missing top-level class documentation comment.","cop_name":"Style/Documentation","corrected":false,"correctable":false,"location":{"start_line":2,"start_column":1,"last_line":2,"last_column":5,"length":5,"line":2,"column":1}},{"severity":"convention","message":"Use `%i` or `%I` for an array of symbols.","cop_name":"Style/SymbolArray","corrected":false,"correctable":true,"location":{"start_line":6,"start_column":34,"last_line":6,"last_column":61,"length":28,"line":6,"column":34}},{"severity":"convention","message":"Do not use space inside array brackets.","cop_name":"Layout/SpaceInsideArrayLiteralBrackets","corrected":false,"correctable":true,"location":{"start_line":6,"start_column":35,"last_line":6,"last_column":35,"length":1,"line":6,"column":35}},{"severity":"convention","message":"Do not use space inside array brackets.","cop_name":"Layout/SpaceInsideArrayLiteralBrackets","corrected":false,"correctable":true,"location":{"start_line":6,"start_column":60,"last_line":6,"last_column":60,"length":1,"line":6,"column":60}},{"severity":"convention","message":"Prefer single-quoted strings when you don't need string interpolation or special symbols.","cop_name":"Style/StringLiterals","corrected":false,"correctable":true,"location":{"start_line":17,"start_column":26,"last_line":17,"last_column":54,"length":29,"line":17,"column":26}},{"severity":"convention","message":"Line is too long. [112/80]","cop_name":"Layout/LineLength","corrected":false,"correctable":true,"location":{"start_line":17,"start_column":81,"last_line":17,"last_column":112,"length":32,"line":17,"column":81}},{"severity":"convention","message":"Use `reject` instead of inverting `select`.","cop_name":"Style/InverseMethods","corrected":false,"correctable":true,"location":{"start_line":30,"start_column":7,"last_line":30,"last_column":59,"length":53,"line":30,"column":7}},{"severity":"convention","message":"Method has too many lines. [14/10]","cop_name":"Metrics/MethodLength","corrected":false,"correctable":false,"location":{"start_line":48,"start_column":3,"last_line":65,"last_column":5,"length":364,"line":48,"column":3}},{"severity":"convention","message":"Use 2 spaces for indentation in a hash, relative to the first position after the preceding left parenthesis.","cop_name":"Layout/FirstHashElementIndentation","corrected":false,"correctable":true,"location":{"start_line":54,"start_column":9,"last_line":54,"last_column":28,"length":20,"line":54,"column":9}},{"severity":"convention","message":"Indent the right brace the same as the first position after the preceding left parenthesis.","cop_name":"Layout/FirstHashElementIndentation","corrected":false,"correctable":true,"location":{"start_line":56,"start_column":7,"last_line":56,"last_column":7,"length":1,"line":56,"column":7}},{"severity":"convention","message":"Use `next` to skip iteration.","cop_name":"Style/Next","corrected":false,"correctable":true,"location":{"start_line":58,"start_column":7,"last_line":58,"last_column":12,"length":6,"line":58,"column":7}},{"severity":"convention","message":"Keep a blank line before and after `private`.","cop_name":"Layout/EmptyLinesAroundAccessModifier","corrected":false,"correctable":true,"location":{"start_line":98,"start_column":3,"last_line":98,"last_column":9,"length":7,"line":98,"column":3}},{"severity":"convention","message":"Use 2 (not 4) spaces for indentation.","cop_name":"Layout/IndentationWidth","corrected":false,"correctable":true,"location":{"start_line":100,"start_column":1,"last_line":100,"last_column":4,"length":4,"line":100,"column":1}},{"severity":"convention","message":"Inconsistent indentation detected.","cop_name":"Layout/IndentationConsistency","corrected":false,"correctable":true,"location":{"start_line":100,"start_column":5,"last_line":102,"last_column":7,"length":57,"line":100,"column":5}},{"severity":"convention","message":"Use 2 (not 4) spaces for indentation.","cop_name":"Layout/IndentationWidth","corrected":false,"correctable":true,"location":{"start_line":105,"start_column":1,"last_line":105,"last_column":4,"length":4,"line":105,"column":1}},{"severity":"convention","message":"Inconsistent indentation detected.","cop_name":"Layout/IndentationConsistency","corrected":false,"correctable":true,"location":{"start_line":105,"start_column":5,"last_line":107,"last_column":7,"length":106,"line":105,"column":5}},{"severity":"convention","message":"Line is too long. [82/80]","cop_name":"Layout/LineLength","corrected":false,"correctable":true,"location":{"start_line":106,"start_column":81,"last_line":106,"last_column":82,"length":2,"line":106,"column":81}},{"severity":"convention","message":"Final newline missing.","cop_name":"Layout/TrailingEmptyLines","corrected":false,"correctable":true,"location":{"start_line":108,"start_column":4,"last_line":108,"last_column":3,"length":0,"line":108,"column":4}}]}],"summary":{"offense_count":19,"target_file_count":1,"inspected_file_count":1}}%        

Actual behavior

Rubocop can't be found.
Language server output:

[Info  - 10:24:05 PM] Initializing Ruby language server...
Loading Ruby tree-sitter syntax from /Users/linhhoang/.vscode/extensions/rebornix.ruby-0.27.0/dist/server/tree-sitter-ruby.wasm
Lint: executing bundle exec rubocop -s /Users/linhhoang/Documents/gatech/humtum/sc-platform/app/controllers/users_controller.rb -f json...
Lint: Received invalid JSON from rubocop:

bundler: command not found: rubocop
Install missing gem executables with `bundle install`

This and the next section should include screenshots, code samples, console output, etc. The more information we have to reproduce the better!
If this is a syntax highlighting report please include a code sample that can be quickly copied and pasted!

@HamptonMakes
Copy link

I have the same issue. :(

@github-actions
Copy link

This issue has not had activity for 30 days. It will be automatically closed in 7 days.

@bmulholland
Copy link

I have this same issue, as does my co-worker. Did anyone fix it? Closing active bugs as stale seems like a good way to lose visibility on active issues...

@bmulholland
Copy link

I found a workaround buried in #229: start vscode from the terminal by running code in your project's directory.

Takes over a second to format anything, though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants