我正在尝试将rspec设置为在VsCode中以调试模式运行

问题描述 投票:0回答:1

我正在尝试设置VsCode以在调试模式下运行我的规范测试。

我已将以下launch.json文件添加到项目中。我正在使用rvm并在该位置安装了必要的宝石,例如rspec。

{
    // 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": "RSpec - all",
            "type": "Ruby",
            "request": "launch",
            "program": "<home>.rvm/gems/ruby-2.4.5/gems/rspec",
            "args": [
                "-I",
                "${workspaceRoot}/spec/*_spec.rb"
            ]
        }
    ]
}

当我在调试模式下运行时,控制台中将显示以下内容。

未捕获的异常:无法加载此类文件 - home-directory / .rvm / gems / ruby​​-2.4.5 / gems / rspec

我根据我找到的文档安装了必要的扩展。红宝石,solargraph和rubicon

任何帮助将不胜感激。

谢谢你,乔

ruby-on-rails ruby rspec visual-studio-code cucumber
1个回答
0
投票

which rspec命令的输出设置为“program”参数。

© www.soinside.com 2019 - 2024. All rights reserved.