Vscode-ruby: Breakpoints not hitting with JRuby

Created on 13 Oct 2017  路  1Comment  路  Source: rubyide/vscode-ruby

Your environment

  • vscode-ruby version: 0.15.0
  • Ruby version: JRuby 9.1.13.0
  • VS Code version: 1.17.1
  • Operating System: macOS
  • Hardware (optional): MacBook Pro

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

ruby-debug-ide (0.6.0)
ruby-debug-base (0.10.6 java)

Expected behavior

Breakpoints should hit in VS Code.

Actual behavior

The code runs, but the breakpoint is never hit. I also cannot click on lines in the DEBUG CONSOLE to navigate to the file in question, so it feels like other things are broken as well.

With MRI 2.4.2, both of these work fine. I have multiple Ruby versions installed using rvm, since we are using different versions for different projects.

Steps to reproduce the problem

Run the RSpec - all target in the Debug view in VS Code. My launch.json is pretty much the autogenerated file, with added env variables to make my app work.

I tried installing the debase gem, but it fails to compile the C extension. Is this gem needed for successful debugging on JRuby?

Most helpful comment

FWIW, the issue still remained but I noted that some of the debugging gems complained on startup saying that it won't be able to trace all events if the process is running without the --debug flag.

Said and done, I added that flag and _now it works_ successfully! Which is incredibly nice. Full launch.json example provided below to help others who might be running into the same issue:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "uxfactory server",
      "type": "Ruby",
      "request": "launch",
      "cwd": "${workspaceRoot}",
      "env": {
        "JRUBY_OPTS": "--debug"
      },
      "program": "${workspaceRoot}/bin/uxfactory",
      "args": [
        "--port",
        "8777"
      ]
    }
  ]
}

>All comments

FWIW, the issue still remained but I noted that some of the debugging gems complained on startup saying that it won't be able to trace all events if the process is running without the --debug flag.

Said and done, I added that flag and _now it works_ successfully! Which is incredibly nice. Full launch.json example provided below to help others who might be running into the same issue:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "uxfactory server",
      "type": "Ruby",
      "request": "launch",
      "cwd": "${workspaceRoot}",
      "env": {
        "JRUBY_OPTS": "--debug"
      },
      "program": "${workspaceRoot}/bin/uxfactory",
      "args": [
        "--port",
        "8777"
      ]
    }
  ]
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ecbrodie picture ecbrodie  路  5Comments

archfish picture archfish  路  5Comments

webmastak picture webmastak  路  4Comments

atracy picture atracy  路  3Comments

pelletencate picture pelletencate  路  5Comments