【发布时间】:2020-10-19 13:24:45
【问题描述】:
我有一个 dockerized RoR 应用程序,我正在尝试使用 rdebug-ide 和 vscode 在调试模式下运行它。 已经添加了宝石 ruby-debug-ide 和 debase。 我在 vscode 上安装了 ruby 扩展并创建了启动配置:
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Docker",
"type": "Ruby",
"request": "attach",
"remoteHost": "0.0.0.0",
"remotePort": "9000",
"remoteWorkspaceRoot": "/app",
"cwd": "${workspaceRoot}",
"showDebuggerOutput": true,
}
]
在 docker-compose.override 我添加了命令:
command: bundle exec rdebug-ide --debug --host 0.0.0.0 --port 9000 -- rails s --host 0.0.0.0 -p 3000
当我运行docker-compose up backend 时,我可以看到调试服务器正在运行:
Fast Debugger (ruby-debug-ide 0.7.2, debase 0.2.4.1, file filtering is supported) listens on 0.0.0.0:9000
问题发生在我在 VSCODE 上启动调试任务时。我收到此错误:
Uncaught exception: cannot load such file -- /app/rails
Dockerfile 上的入口点和工作目录:
WORKDIR /app
ENTRYPOINT ["bundle", "exec"]
CMD ["rails", "server", "--binding=0.0.0.0"]
如果我使用docker-compose up backend 正常运行应用程序并执行docker container ls 我可以看到启动命令:
bundle exec rails server --binding=0.0.0.0
【问题讨论】:
-
我也有同样的问题!但我还没有找到解决办法。有解决办法吗?
标签: ruby-on-rails docker visual-studio-code vscode-debugger ruby-debug