VS Code 调试 Ruby Gem 包 (Cocoapods)

63 阅读1分钟

前言

没有 RubyMine,尝试用 vscode debug gem 包

准备素材

  1. 安装 Debug 工具 VSCode Ruby rdbg Debugger
  2. 安装 bundler gem install bundler
  3. 执行 budnle install bundle install

准备 launch.json

{
    "version": "0.2.0",
    "configurations": [
      {
        "type": "rdbg",
        "name": "Debug pod install MySample",
        "request": "launch",
        "script": "/Users/xxx/xx/bundler",
        "args": [
            "exec",
            "pod",
            "install",
            "--verbose",
        ],
        "cwd": "${workspaceFolder}",
        "env": {
          "LANG": "en_US.UTF-8"
        },
        "useBundler": true,
        "askParameters": false,
      }
    ]
}

开始 debug

  1. 先打断点

image.png

  1. 开启 debug

image.png

  1. 进入断点

image.png