Home > Mobile >  How do I set VSCode path so that it picks up my rufo extension for my Ruby on Rails project?
How do I set VSCode path so that it picks up my rufo extension for my Ruby on Rails project?

Time:03-08

I’m using VS Code 1.65.0 on Mac Big Sur. I have installed the rufo gem and the rufo-vscode extension (https://marketplace.visualstudio.com/items?itemName=siliconsenthil.rufo-vscode). After restarting VSCode, when I enter the shortcut (Cmd Shift I) to format a file, I get this error

rufo not available in path. Ensure rufo gem is installed

I’m not clear where VSCode is getting it’s path. On my command line, I get this

$ which rufo
/Users/myuser/.rvm/gems/ruby-3.0.2@myproject/bin/rufo

And this path is in my $PATH var, when I check my shell

$ echo $PATH
/Users/myuser/.rvm/gems/ruby-3.0.2@myproject/bin:/Users/myuser/.rvm/gems/ruby-3.0.2@global/bin:/Users/myuser/.rvm/rubies/ruby-3.0.2/bin:/Users/myuser/.rvm/bin:/usr/local/opt/mysql-client/bin:/Users/myuser/.nvm/versions/node/v14.15.1/bin:/Users/myuser/.opam/4.08.1/bin:/usr/local/opt/[email protected]/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Where do I need to enter this info in VSCode so that it picks up ruff?

CodePudding user response:

Open your settings.json in VSC and enter your which rufo output:

{
  ...
  "rufo.exe": "/Users/myuser/.rvm/gems/ruby-3.0.2@myproject/bin/rufo",
  ...
}
  • Related