Vscode-ruby: [Ruby] Unable to debug .rb file and getting debugger terminal error.

Created on 18 Mar 2016  路  12Comments  路  Source: rubyide/vscode-ruby

VSCode Version: 0.10.12-alpha
鈥S Version: Windows10 -Ruby Version: rubyinstaller-2.2.4-x64 (install location : http://rubyinstaller.org/downloads/)

Steps to Reproduce:

  1. Launch app and open a folder which contains .rb file.
  2. Install all the ruby extensions and restart app.
  3. Add some break point in .rb file.
  4. Debug .rb file with option "Debug local file"

Actual: Getting Error like : Debugger terminal error: Process failed: spawn rdebug-ide.bat ENOENT
image

Most helpful comment

I had this same issue. I am using windows 10 and installed ruby 2.3.0 (x64) off my C drive, but not the dev kit. The issue is that vscode was looking for the rdebug-ide.bat file and I did not have that. I took the following steps to fix this.

  1. I downloaded and installed the Ruby Dev Kit. http://jekyll-windows.juthilo.com/1-ruby-and-devkit/
  2. I ran gem and installed the ruby-debug-ide.
    gem install ruby-debug-ide
    This will install a the rdebug-ide.bat file with the other gems in your ruby folder.

After that the debugger worked fine.

Hope this helps some people.

All 12 comments

@v-pavanp Could you please check whether you have installed the Ruby related gems per documentation, maybe you can provide your gem list by running gem list in your terminal. Thanks!

Here is the gem list. I could see the second last item in the below list is the one which is listed in the document.

I installed Ruby v2.0.x.

C:Ruby22-x64bin>gem list

* LOCAL GEMS *

bigdecimal (1.2.6)
debase (0.2.1)
debase-ruby_core_source (0.8.4)
io-console (0.4.3)
json (1.8.1)
minitest (5.4.3)
power_assert (0.2.2)
psych (2.0.8)
rake (10.4.2)
rdoc (4.2.0)
ruby-debug-ide (0.4.32)

test-unit (3.0.8)

Just to say that I had this same error and it is caused by the rdebug-ide command not being available in the workspace root that you are trying to debug.

i.e. if you browse to your workspace in a terminal and try and run it you will get:

C:\my_app>rdebug-ide myapp
'rdebug-ide' is not recognized as an internal or external command,
operable program or batch file.

So you need to fix that first, then vs-code Ruby will work.

The problem here may be specific to your app, but in my case it seems that Bundler does not work perfectly on Windows. I am using binstubs to access the bundled commands, and when I added ruby-debug-ide to the app bundle the binstubs dir was not updated (like it would have been on Linux).

So the solution was to delete my binstubs dir, re-run bundler, and then the binstubs were re-built, now included rdebug-ide.
Now it works in the console, and when I then re-try vscode-ruby, it works there too:

C:\my_app>rdebug-ide myapp
Fast Debugger (ruby-debug-ide 0.6.0, debase 0.2.1, file filtering is supported) listens on 127.0.0.1:1234

@ginty Thanks Stephen, I haven't got time on this bug these days and your solution is likely the right one. And for your information, VS Code will support RHEL from March Release ( maybe after //Build ).

Oh wow, great news re. RHEL (assuming that means RHEL6)!

Also thanks for adding args support, I tried to add it myself but didn't have time, it works great!

@rebornix, @v-pavanp, and @ginty: Basically this comes down to the wrapper script (rdebug-ide or rdebug-ide.bat) not being present in the executable search path. I'll do some experimentation with bundler, but the end result may just be to include a pathToRDebugIDE option in the launch settings.

I've setup a clean install of ruby, and bundler and can't reproduce this issue. The only time I can cause a 'ENOENT' is by opening the project without ruby-debug-ide installed. Once installing ruby-debug-ide I did have to restart VSCode to ensure it had read the new %PATH% structure.

Closing due to lack of activity.

I had this same issue. I am using windows 10 and installed ruby 2.3.0 (x64) off my C drive, but not the dev kit. The issue is that vscode was looking for the rdebug-ide.bat file and I did not have that. I took the following steps to fix this.

  1. I downloaded and installed the Ruby Dev Kit. http://jekyll-windows.juthilo.com/1-ruby-and-devkit/
  2. I ran gem and installed the ruby-debug-ide.
    gem install ruby-debug-ide
    This will install a the rdebug-ide.bat file with the other gems in your ruby folder.

After that the debugger worked fine.

Hope this helps some people.

The above fix worked for me. I installed the appropriate DevKit for my Ruby installation, and then I installed ruby-debug-ide. Thanks!

I'm getting this error on Ubuntu 16.04. I'm using ruby 2.4 via rvm. rdebug-ide is installed at ~/.rvm/gems/ruby-2.4.0-rc1/bin/debug-ide, which is in my $PATH. I am able to start rdebug-ide manually via terminal and then connect, but is there any way just point VSCode to where rdebug-ide is kept?

How to fix this in linux ?? as there is no devkit available to ubuntu

Was this page helpful?
0 / 5 - 0 ratings