How to fix “rubocop failed with code=7” error in vscode

Today I was trying to get rubocop working with vscode right now and I wasn’t having much luck. I read one comment on a thread that mentioned a weird quirk about how you open vscode.

It said that if you open vscode from the terminal then it knows the correct ruby environment to run in, but if you just click on the app it doesn’t.

I have no idea if that is actually true, but I can say that the error goes away when I open code from the command line. Now I’m one step closer to squiggly green lines everywhere!