首页 > 解决方案 > 如何让语言特定命令在 VSCode 中工作?

问题描述

我是 Visual Studio Code 的新手,我正在尝试在终端中运行命令来处理我的项目。我将默认终端更改为 Git Bash,但这不起作用。当我运行特定命令时,我得到错误。以下是 Ruby 的示例:

$ bundle install
bash: bundle: command not found

每当我尝试运行 ruby​​/rails 命令时都会发生这种情况。我使用的是 Windows,是否需要编辑特定设置才能修复此问题?

标签: visual-studio-code

解决方案


将此添加到您的 VSCodesettings.json文件中

"terminal.integrated.shell.windows": "C:\\Program Files (x86)\\Git\\bin\\bash.exe",
"terminal.integrated.shellArgs.windows": ["--login", "-i"]

来源


推荐阅读