Vscode-ruby: breakpoint not being hit in remote debugging

Created on 30 Jul 2016  路  7Comments  路  Source: rubyide/vscode-ruby

Your environment

  • vscode-ruby version: 0.5.2
  • Ruby version: ruby 2.2.2p95
  • VS Code version: Version 1.3.0-insider
  • Operating System: ubuntu 14.04
  • ruby-debug-ide : 0.6.0

config looks like:

{
   "name": "Listen for rdebug-ide",
   "type": "Ruby",
   "request": "attach",
   "cwd": "${workspaceRoot}",
   "remoteHost": "127.0.0.1",
   "remotePort": "1234",
   "remoteWorkspaceRoot": "${workspaceRoot}"
 }

Make sure you have ruby, ruby-debug-ide and ruby-debug-basex19 installed before submitting your issue -- thank you !

Expected behavior

on remote server I:

$ rdebug-ide try.rb 
Fast Debugger (ruby-debug-ide 0.6.0, debase 0.2.1, file filtering is supported) listens on 127.0.0.1:1234

I have ssh tunnel to remote host on same port.
I set a breakpoint in the code.

I click run in debugger.
expect debugger to stop at breakpoint, It doesn't it runs the program to completion.

Actual behavior

doesn't stop at breakpoint.

Steps to reproduce the problem

question

Most helpful comment

I just ran into this issue with VSCode and was able to fix it by changing the remoteWorkspaceRoot in the launch.json configuration to the path of the Vagrant guest. By default it has:

        {
            "name": "Listen for rdebug-ide",
            "type": "Ruby",
            "request": "attach",
            "cwd": "${workspaceRoot}",
            "remoteHost": "127.0.0.1",
            "remotePort": "1234",
            "remoteWorkspaceRoot": "${workspaceRoot}"
        }

Change:

"remoteWorkspaceRoot": "/home/vagrant/XXXX"

All 7 comments

@jots
You must configure "remoteWorkspaceRoot". :)

I have the same problem.
I'm using Vagrant and I can successfully launch the debug-ide on the remote VM. Then, after clicking the debug arrow in VScode, it launches my Rails app and everything works fine. However, if I set some breakpoints and try to load the related webpages, it just freezes and the webpage never loads, as if the breakpoint had been hit, except it doesn't. There's no indication of anything happening whatsoever on the vscode debug panel.

I just ran into this issue with VSCode and was able to fix it by changing the remoteWorkspaceRoot in the launch.json configuration to the path of the Vagrant guest. By default it has:

        {
            "name": "Listen for rdebug-ide",
            "type": "Ruby",
            "request": "attach",
            "cwd": "${workspaceRoot}",
            "remoteHost": "127.0.0.1",
            "remotePort": "1234",
            "remoteWorkspaceRoot": "${workspaceRoot}"
        }

Change:

"remoteWorkspaceRoot": "/home/vagrant/XXXX"

@codemeow5 What should it point to?

Closing for issue cleanup. Apologies if this is still an issue. We are working to improve the core extension experience.

@johnkchiu is correct: you need to give "remoteWorkspaceRoot" the correct value. The value should be the absolute path where your remote Ruby project lives.

For my Docker image, this was in /usr/src/app, so I set "remoteWorkspaceRoot": "/usr/src/app" and breakpoints started working.

I finally managed to get this working (with some help!) in the end using the insider build of VS code (1.35.0-insider). Set up as follows

        {
            "name": "Rails server",
            "type": "Ruby",
            "request": "launch",
            "cwd": "${workspaceRoot}",
            "showDebuggerOutput": true,
            "program": "${workspaceRoot}/bin/rails",
            "args": [
               "s"
            ]
        }

I had to uninstall older versions of debase and ruby-debug-ide and update to the latest beta versions. It now respects breakpoints. Current Version information:
Ruby: 2.5.1
Rails: 5.2.0
ruby-debug-ide: (0.7.0.beta7)
Debase: 0.2.3.beta5

I also did the following:

  1. bundle binstubs ruby-debug-ide
  2. bundle binstubs railties
  3. bundle binstubs bundler --force
Was this page helpful?
0 / 5 - 0 ratings

Related issues

rachsmithcodes picture rachsmithcodes  路  5Comments

chrisnicola picture chrisnicola  路  5Comments

SerkanOruc picture SerkanOruc  路  5Comments

webmastak picture webmastak  路  4Comments

Snake-Sanders picture Snake-Sanders  路  4Comments