[RUBY] "Debugger terminal error: Process failed: spawn bundle ENOENT" in Windows VS Code environment

Trouble

I want to debug Ruby with Windows VS Code. First of all, since I want to debug in the environment via bundler, I started by setting `useBundler``` of launch.json with `true```

launch.json


{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug Local File",
            "type": "Ruby",
            "request": "launch",
            "program": "${workspaceRoot}/main.rb",
            "useBundler": true
        }
    ]
}

When I start debugging, the following error is displayed in DEBUG CONSOLE of VS Code.

Debugger terminal error: Process failed: spawn bundle ENOENT



 swpawn is an abbreviation for "generate" in Japanese, ["ENOENT" is an abbreviation for Error No Etry "](https://qiita.com/YumaInaura/items/4b664cd00675502407ba)
 In other words, "I tried to create a bundle process, but I can't find it."

## solution

 Write a description in launch.json that allows bundle to be called.
```pathtobundler```The part of is the description.


#### **`launch.json`**
```json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug Local File",
            "type": "Ruby",
            "request": "launch",
            "program": "${workspaceRoot}/main.rb",
            "useBundler": true,
            "pathToBundler": "bundle.bat"
        }
    ]
}

that's all

Recommended Posts

"Debugger terminal error: Process failed: spawn bundle ENOENT" in Windows VS Code environment
Create Spring Boot environment with Windows + VS Code
exited with code 1 error resolution with docker-compose up in rails environment
Resolve CreateProcess error = 206 when running Java in a Windows environment