如何设置 VSCode 路径,以便它为 Rails 项目上的 Ruby 选择我的 rufo 扩展?
How do I set VSCode path so that it picks up my rufo extension for my Ruby on Rails project?
我在 Mac Big Sur 上使用 VS Code 1.65.0。我已经安装了 rufo gem 和 rufo-vscode 扩展 (https://marketplace.visualstudio.com/items?itemName=siliconsenthil.rufo-vscode)。重启后VSCode,输入快捷方式(Cmd+Shift+I)格式化文件时,报错
rufo not available in path. Ensure rufo gem is installed
我不清楚 VSCode 是从哪里得到它的路径的。在我的命令行上,我得到这个
$ which rufo
/Users/myuser/.rvm/gems/ruby-3.0.2@myproject/bin/rufo
当我检查 shell
时,这条路径在我的 $PATH 变量中
$ 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/ansible@2.9/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
我需要在 VSCode 中的什么地方输入此信息,以便它拾取 ruff?
在 VSC 中打开 settings.json
并输入 which rufo
输出:
{
...
"rufo.exe": "/Users/myuser/.rvm/gems/ruby-3.0.2@myproject/bin/rufo",
...
}
我在 Mac Big Sur 上使用 VS Code 1.65.0。我已经安装了 rufo gem 和 rufo-vscode 扩展 (https://marketplace.visualstudio.com/items?itemName=siliconsenthil.rufo-vscode)。重启后VSCode,输入快捷方式(Cmd+Shift+I)格式化文件时,报错
rufo not available in path. Ensure rufo gem is installed
我不清楚 VSCode 是从哪里得到它的路径的。在我的命令行上,我得到这个
$ which rufo
/Users/myuser/.rvm/gems/ruby-3.0.2@myproject/bin/rufo
当我检查 shell
时,这条路径在我的 $PATH 变量中$ 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/ansible@2.9/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
我需要在 VSCode 中的什么地方输入此信息,以便它拾取 ruff?
在 VSC 中打开 settings.json
并输入 which rufo
输出:
{
...
"rufo.exe": "/Users/myuser/.rvm/gems/ruby-3.0.2@myproject/bin/rufo",
...
}