Cannot execute rubocop in WSL from Windows
See original GitHub issueThe file name of rubocop in WSL is rubocop
, same as Linux. However, when VSCode is installed in Windows, configuration.ts
tries to use rubocop.bat
. So that, the extension cannot find the executable rubocop
in WSL from VSCode in Windows.
Error message my_path_to_rubocop_in_wsl/rubocop.bat is not executable
I need an additional configuration to use WSL. We can execute a file in WSL from Windows:
C:\> wsl my_path_to_rubocop_in_wsl/rubocop
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
Error on config Rubocop for VSCODE in WSL2 - Stack Overflow
Show activity on this post. A last try: create a bash script in windows to point to rubocop. Then in VSCODE: "ruby. rubocop....
Read more >Ruby rubocop on WSL : r/bashonubuntuonwindows - Reddit
Has anyone successfully installed rubocop on WSL (ubuntu)? I've tried every suggestion on every stackoverflow post but no success.
Read more >WSL2: Run anything in project from wsl-host with wsl-sdk : RUBY ...
RUBY-27748 Cannot run docker-compose in rubymine on Windows 10 using wsl2 ... RUBY-27816 Rubocop not picking up .rubocop.yml in project directory under WSL....
Read more >My rspec problem: When your code is correct but RuboCop ...
So I've set up my development environment in a WSL Bash shell on my Windows 10 PC. I try to test code using...
Read more >Configuring WSL for ruby - Glenn Sarti
While still in Beta, this allows Windows to run native ubuntu binaries on Windows, that is, running Linux as a subsystem on Windows....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I use a workaround with a
.bat
file that I can reference in the vscode settings:(I use rvm inside WSL, but you should be able to adjust for your own environment) Inspired by https://hackernoon.com/wsl-hacks-making-atom-linters-work-with-windows-subsystem-for-linux-c86d42eaf09e
It works! My
rubocop.bat
looks like this. (I userbenv
.)In the end, I needed to convert Windows path in args into WSL path.
https://gist.github.com/aseering/a06219e74c7f96ccea5ec65d5b2483b5