我在 MacOS Sierra 上使用 rbenv。
这是我的 Rails 服务器配置的配置:
{
"name": "Rails server",
"type": "Ruby",
"request": "launch",
"cwd": "${workspaceRoot}",
"useBundler": true,
"program": "${workspaceRoot}/bin/rails",
"args": [
"server"
]
}
我已经为“args”键尝试了以下值:
"args": [
"server",
"-p 4002"
]
但我会收到以下错误:
Exiting
bundler: failed to load command: rdebug-ide (/Users/knockycode/vendor/bundle/bin/rdebug-ide)
Uncaught exception: cannot load such file -- rack/handler/-p 4002
最佳答案
我发现 -p 4002
包含两个参数:-p
标志和 4002
标志值;这不是一个完整的论点。
工作配置:
{
"name": "Rails server",
"type": "Ruby",
"request": "launch",
"cwd": "${workspaceRoot}",
"useBundler": true,
"program": "${workspaceRoot}/bin/rails",
"args": [
"server",
"-p",
"4002"
]
}
关于ruby-on-rails - 如何在 MacOS 上的 VS Code 上的不同端口(不是默认端口 3000)上调试 Rails 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48731803/