using ruby extension, rubocop with Visual Studio Code

Viewed 3306

trying to use the VS code extension Ruby. And having it format files on save with rubocop.

But when saving i'm getting the error env: ruby_executable_hooks: No such file or directory

  "ruby.useLanguageServer": true,
  "ruby.lint": {
    "rubocop": {
      "useBundler": true
    }
  },
  "ruby.rubocop.executePath": "/Users/jac/.rvm/gems/ruby-2.6.6/bin/"

These are the ruby settings in settings.json.

I searched around and was suggested to change bin, to wrappers, and after finding out i didn't have any wrappers for some reason, i rebuild them, and attempted it, But got this long error cannot load such file -- rubocop-rails

I'm new to all ruby related stuff, so might be something obvious i'm missing.

1 Answers

I was able to get the formatting and linting working. After disabling "use bundler" and having rubocop installed globally with gem install rubocop

Related