InfoGrab DocsInfoGrab Docs

VS Code 디버깅

GDK를 사용하여 Visual Studio Code에서 Rails 디버깅을 설정하는 방법을 설명합니다.

이 문서에서는 GitLab Development Kit(GDK) 를 사용하여 Visual Studio Code(VS Code) 에서 Rails 디버깅을 설정하는 방법을 설명합니다. 설정 # 아래 예시에는 rails-web 및 rails-background-jobs 에 대한 실행 설정이 포함되어 있습니다. gitlab 폴더 내에서 gem install debug 를 실행하여 debug gem을 설치합니다. VS Code에 rdbg 디버거 유형 지원을 추가하려면 VS Code Ruby rdbg Debugger 확장을 설치합니다. VS Code를 통해 GitLab 및 관련 Ruby Rails/Sidekiq 프로세스를 자동으로 중지하고 시작하려는 경우, .vscode/tasks.json 파일의 설정에 다음 VS Code 태스크를 추가할 수 있습니다: { "version": "2.0.0", "tasks": [ { "label": "start rdbg for rails-web", "type": "shell", "command": "gdk stop rails-web && GITLAB_RAILS_RACK_TIMEOUT_ENABLE_LOGGING=false PUMA_SINGLE_MODE=true rdbg --open -c bin/rails server", "isBackground": true, "problemMatcher": { "owner": "rails", "pattern": { "regexp": "^.*$", }, "background": { "activeOnStart": false, "beginsPattern": "^(ok: down:).*$", "endsPattern": "^(DEBUGGER: wait for debugger connection\\.\\.\\.)$" } } }, { "label": "start rdbg for rails-background-jobs", "type": "shell", "command": "gdk stop rails-background-jobs && rdbg --open -c bundle exec sidekiq", "isBackground": true, "problemMatcher": { "owner": "sidekiq", "pattern": { "regexp": "^(DEBUGGER: wait for debugger connection\\.\\.\\.)$" }, "background": { "activeOnStart": false, "beginsPattern": "^(ok: down:).*$", "endsPattern": "^(DEBUGGER: wait for debugger connection\\.\\.\\.)$" } } } ] } .vscode/launch.json 파일에 다음 설정을 추가합니다: { "version": "0.2.0", "configurations": [ { "type": "rdbg", "name": "Attach rails-web with rdbg", "re