After install Rubocop extension. I get warning alert this alert in VS code.
Error on parsing output (It might non-JSON output) : "{"metadata":{"rubocop_version":"0.52.1","ruby_engine":"ruby","ruby_version":"2.4.1","ruby_patchlevel"
This my file workspace setting
{
"ruby.rubocop.executePath": "/Users/foo/.rvm/gems/ruby-2.4.1/bin/",
"ruby.rubocop.configFilePath": "/Users/foo/git/project_name/.rubocop.yml",
"ruby.rubocop.onSave": true
}
This content in file .rubocop.yml
AllCops:
Exclude:
- 'vendor/**/*'
- 'spec/fixtures/**/*'
- 'tmp/**/*'
- 'db/schema.rb'
- 'db/migrate/**/*'
- 'lib/tasks/**/*'
I had this error and the problem was that there were too many “offenses” in the code.
The solution was to run rubocop from the command line and correct enough offenses until it was manageable by the extension. I used rubocop —auto-correct filename.rb
to correct a lot of the errors.
I’ve seen others use different solutions to resolve this error on the GitHub Issues tracker for the VS Code ruby-rubocop extension.