Debugger terminal error process failed spawn rdebug ide enoent

Your environment vscode-ruby version: 0.15.0 Ruby version: 2.4.2 VS Code version: 1.16.1 Operating System: Antergos Hardware (optional): Intel Core i5 system with integrated Intel graphics Make sur...

Your environment

  • vscode-ruby version: 0.15.0
  • Ruby version: 2.4.2
  • VS Code version: 1.16.1
  • Operating System: Antergos
  • Hardware (optional): Intel Core i5 system with integrated Intel graphics

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

I have ruby-debug-ide installed but I cannot install the ruby-debug-base gem. It says it cannot find it in a repository. I think this instruction might be outdated since the wiki says to install the «debase» gem if we have Ruby 2.0 or higher.

Expected behavior

Able to launch debugging.

Actual behavior

Debugging doesn’t launch. VS Code output console says:

Debugger terminal error: Process failed: spawn rdebug-ide ENOENT

Steps to reproduce the problem

I followed the installation instructions including installing the dependencies. I installed the VS Code extension «ruby» and then I saw these instructions for dependencies:

If you are using Ruby v2.x
gem install ruby-debug-ide -v 0.4.32 or higher versions
gem install debase -v 0.2.1 or higher versions

So I performed these installs and made sure they were in my gems:

$ gem list | grep "ide"
ruby-debug-ide (0.6.0)
$ gem list | grep "debase"
debase (0.2.2.beta10, 0.2.1)
debase-ruby_core_source (0.9.10)

I then followed the instructions to create the «launch.json» file automatically by going to the debug area of VS Code and choosing Ruby. My launch.json file looks like this right now:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug Local File",
            "type": "Ruby",
            "request": "launch",
            "cwd": "${workspaceRoot}",
            "program": "${workspaceRoot}/main.rb"
        },
        {
            "name": "Listen for rdebug-ide",
            "type": "Ruby",
            "request": "attach",
            "cwd": "${workspaceRoot}",
            "remoteHost": "127.0.0.1",
            "remotePort": "1234",
            "remoteWorkspaceRoot": "${workspaceRoot}"
        },
        {
            "name": "Rails server",
            "type": "Ruby",
            "request": "launch",
            "cwd": "${workspaceRoot}",
            "program": "${workspaceRoot}/bin/rails",
            "args": [
                "server"
            ]
        },
        {
            "name": "RSpec - all",
            "type": "Ruby",
            "request": "launch",
            "cwd": "${workspaceRoot}",
            "program": "${workspaceRoot}/bin/rspec",
            "args": [
                "-I",
                "${workspaceRoot}"
            ]
        },
        {
            "name": "RSpec - active spec file only",
            "type": "Ruby",
            "request": "launch",
            "cwd": "${workspaceRoot}",
            "program": "${workspaceRoot}/bin/rspec",
            "args": [
                "-I",
                "${workspaceRoot}",
                "${file}"
            ]
        },
        {
            "name": "Cucumber",
            "type": "Ruby",
            "request": "launch",
            "cwd": "${workspaceRoot}",
            "program": "${workspaceRoot}/bin/cucumber"
        }
    ]
}

However, when I select «Rails server» as a debug option and click the green arrow, it starts and closes immediately and I get the following message in the output console:

Debugger terminal error: Process failed: spawn rdebug-ide ENOENT

In the wiki, I noticed these instructions:

Using rvm

The default rvm will be used to run the debugger, which can lead to unexpected results if your default differs from the ruby version configured for your repo. The workaround is to change rvm's default ruby version to match the repo's expected version. In a terminal, type rvm use <ruby-version> --default to get things working. Once this is done, specifying the bundler & rdebug-ide paths is no longer required, and things load properly.

Since I use RVM, I used the rvm use 2.4.2 --default command so that my terminal would always have a Ruby selected.

Unfortunately, this did not fix the issue with VS Code debugging.

This is the RVM-related section of my .bashrc file that I had to set to get my terminal to be ready for Ruby commands when it launches:

# Fixes the "rvm is not a function"
source $HOME/.rvm/scripts/rvm

# Add RVM to PATH for scripting. Make sure this is the last PATH variable chang.
export PATH="$PATH:$HOME/.rvm/bin"

I noticed that the error message mentions an «rdebug-ide» gem so I checked my terminal to see if it could at least find this gem, I’m wondering if it could be PATH issues:

$ which rdebug-ide
/home/mwelke/.rvm/gems/ruby-2.4.2/bin/rdebug-ide

I notice the debug environment «Rails server» is attempting to run a binary in «bin» directory so I also checked to ensure I have that binary there:

├── bin
│   ├── bundle
│   ├── bundler
│   ├── byebug
│   ├── listen
│   ├── nokogiri
│   ├── puma
│   ├── pumactl
│   ├── rackup
│   ├── rails
│   ├── rake
│   ├── sass
│   ├── sass-convert
│   ├── scss
│   ├── setup
│   ├── spring
│   ├── sprockets
│   ├── thor
│   ├── tilt
│   ├── update
│   └── yarn

And it can… so I’m still pretty baffled right now. I suspect it has something to do with PATH, my setup, etc. Was wondering if anyone could help?

EDIT:

In order to discover more about what might be causing the issue, I tried to set up a debugging session using the «Listen for rdebug-ide» debugging environment. I created a script and called «rdebug-ide» from the terminal to look at a test script I made. I then started debugging this way from VS Code and it was able to start. It seemed to work fine.

I spent most of a day trying to solve this.

I ended up stripping my launch.json config down to the following:

"configurations": [
    {
       "name": "Rails server",
        "type": "Ruby",
        "request": "launch",
        "cwd": "${workspaceRoot}",
        "program": "/Users/mitch/.rvm/gems/ruby-2.3.0@gg_portal/bin/rails",
        "args": [
            "server"
        ],
        "useBundler": true,
        "pathToRDebugIDE": "/Users/mitch/.rvm/gems/ruby-2.3.0@gg_portal/gems/ruby-debug-ide-0.6.1",
        "pathToBundler": "/Users/mitch/.rvm/gems/ruby-2.3.0@gg_portal/wrappers/bundle",
        "showDebuggerOutput": true
    }

]

Firstly, especially if you’re using RVM & have different Gemsets, make sure your paths are consistent with the correct Gemset.

What solved the problem for me was pathToBundler.

which bundle
/Users/mitch/.rvm/gems/ruby-2.3.0@gg_portal/bin/bundle

There looks to be some incompatibility around setting the path to the binstubs bundler (shown above) and the bundler pointed to from /wrappers/ (shown below), so changing pathToBundler to:

"pathToBundler": "/Users/mitch/.rvm/gems/ruby-2.3.0@gg_portal/wrappers/bundle",

solved the problem.

There is a kind of related discussion here:

https://github.com/rails/rails/issues/31193

which talks about binstubs though not specifically VSCode & debugging.

Ваше окружение

  • vscode-ruby версия: 0.15.0
  • Версия Ruby: 2.4.2
  • Версия кода VS: 1.16.1
  • Операционная система: Antergos
  • Аппаратное обеспечение (необязательно): система Intel Core i5 со встроенной графикой Intel

Перед отправкой проблемы убедитесь, что у вас установлены ruby , ruby-debug-ide и ruby-debug-basex19 — спасибо!

У меня установлен ruby-debug-ide, но я не могу установить гем ruby-debug-base. Я думаю, что эта инструкция может быть устаревшей, поскольку в вики говорится об установке гема «debase», если у нас есть Ruby 2.0 или выше.

Ожидаемое поведение

Возможность запустить отладку.

Фактическое поведение

Отладка не запускается. Консоль вывода VS Code говорит:

Debugger terminal error: Process failed: spawn rdebug-ide ENOENT

Шаги по воспроизведению проблемы

Я выполнил инструкции по установке, включая установку зависимостей. Я установил расширение VS Code «ruby» и увидел следующие инструкции для зависимостей:

If you are using Ruby v2.x
gem install ruby-debug-ide -v 0.4.32 or higher versions
gem install debase -v 0.2.1 or higher versions

Итак, я выполнил эти установки и убедился, что они в моем драгоценном камне:

$ gem list | grep "ide"
ruby-debug-ide (0.6.0)
$ gem list | grep "debase"
debase (0.2.2.beta10, 0.2.1)
debase-ruby_core_source (0.9.10)

Затем я выполнил инструкции по автоматическому созданию файла «launch.json», перейдя в область отладки VS Code и выбрав Ruby. Мой файл launch.json сейчас выглядит так:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug Local File",
            "type": "Ruby",
            "request": "launch",
            "cwd": "${workspaceRoot}",
            "program": "${workspaceRoot}/main.rb"
        },
        {
            "name": "Listen for rdebug-ide",
            "type": "Ruby",
            "request": "attach",
            "cwd": "${workspaceRoot}",
            "remoteHost": "127.0.0.1",
            "remotePort": "1234",
            "remoteWorkspaceRoot": "${workspaceRoot}"
        },
        {
            "name": "Rails server",
            "type": "Ruby",
            "request": "launch",
            "cwd": "${workspaceRoot}",
            "program": "${workspaceRoot}/bin/rails",
            "args": [
                "server"
            ]
        },
        {
            "name": "RSpec - all",
            "type": "Ruby",
            "request": "launch",
            "cwd": "${workspaceRoot}",
            "program": "${workspaceRoot}/bin/rspec",
            "args": [
                "-I",
                "${workspaceRoot}"
            ]
        },
        {
            "name": "RSpec - active spec file only",
            "type": "Ruby",
            "request": "launch",
            "cwd": "${workspaceRoot}",
            "program": "${workspaceRoot}/bin/rspec",
            "args": [
                "-I",
                "${workspaceRoot}",
                "${file}"
            ]
        },
        {
            "name": "Cucumber",
            "type": "Ruby",
            "request": "launch",
            "cwd": "${workspaceRoot}",
            "program": "${workspaceRoot}/bin/cucumber"
        }
    ]
}

Однако, когда я выбираю «Rails server» в качестве параметра отладки и нажимаю зеленую стрелку, он запускается и немедленно закрывается, и я получаю следующее сообщение в консоли вывода:

Debugger terminal error: Process failed: spawn rdebug-ide ENOENT

В вики заметил такие инструкции:

Using rvm

The default rvm will be used to run the debugger, which can lead to unexpected results if your default differs from the ruby version configured for your repo. The workaround is to change rvm's default ruby version to match the repo's expected version. In a terminal, type rvm use <ruby-version> --default to get things working. Once this is done, specifying the bundler & rdebug-ide paths is no longer required, and things load properly.

Поскольку я использую RVM, я использовал команду rvm use 2.4.2 --default чтобы в моем терминале всегда был выбран Ruby.

К сожалению, это не устранило проблему с отладкой VS Code.

Это связанный с RVM раздел моего файла .bashrc который я должен был настроить, чтобы мой терминал был готов к командам Ruby при его запуске:

# Fixes the "rvm is not a function"
source $HOME/.rvm/scripts/rvm

# Add RVM to PATH for scripting. Make sure this is the last PATH variable chang.
export PATH="$PATH:$HOME/.rvm/bin"

Я заметил, что в сообщении об ошибке упоминается гем «rdebug-ide», поэтому я проверил свой терминал, чтобы увидеть, может ли он хотя бы найти этот драгоценный камень, мне интересно, может ли это быть проблема с PATH:

$ which rdebug-ide
/home/mwelke/.rvm/gems/ruby-2.4.2/bin/rdebug-ide

Я заметил, что среда отладки «Rails server» пытается запустить двоичный файл в каталоге «bin», поэтому я также проверил, есть ли этот двоичный файл там:

├── bin
│   ├── bundle
│   ├── bundler
│   ├── byebug
│   ├── listen
│   ├── nokogiri
│   ├── puma
│   ├── pumactl
│   ├── rackup
│   ├── rails
│   ├── rake
│   ├── sass
│   ├── sass-convert
│   ├── scss
│   ├── setup
│   ├── spring
│   ├── sprockets
│   ├── thor
│   ├── tilt
│   ├── update
│   └── yarn

И это может … так что я все еще очень сбит с толку прямо сейчас. Я подозреваю, что это как-то связано с PATH, моей настройкой и т. Д. Интересно, может ли кто-нибудь помочь?

РЕДАКТИРОВАТЬ:

Чтобы узнать больше о том, что может быть причиной проблемы, я попытался настроить сеанс отладки, используя среду отладки «Listen for rdebug-ide». Я создал сценарий и вызвал из терминала «rdebug-ide», чтобы посмотреть созданный мной тестовый сценарий. Затем я начал отладки этого пути от VS кодекса , и это было в состоянии начать. Казалось, все работает нормально .

Your environment

  • vscode-ruby version: letest
  • Ruby version: 2.6.4p104
  • Ruby version manager (if any):
  • VS Code version: 1.55.2
  • Operating System:windows 10
  • Using language server? no

Expected behavior

working debuger

Actual behavior

getting :

Debugger terminal error: Process failed: spawn rdebug-ide.bat ENOENT 

im trying to making ruby installed in Cygwin to work , i successfully installed ruby and and ruby-devel in cygwin .
Started visual studio code from Cygwin and its working fine
my launch.json configuration : ( taken from several SOF suggestions )

"version": "0.2.0",
    
    "configurations": [
        {
            
            "name": "Debug Local File",
            "type": "Ruby",
            "request": "launch",
            "cwd": "${workspaceFolder}",
            "program": "${workspaceFolder}/test.rb",
            "env": {
                "Path": "${env:Path};C:\cygwin64\bin;/home/my/.gem" ,
                "GEM_HOME": "/home/my/.gem",
                "GEM_PATH": "/home/my/.gem",
                "RUBY_VERSION": "2.6.4p104"
            },
            "showDebuggerOutput": true,
           
            "args": [
                "server"
            ]
        }
    ]
}

my workspace settings.json config:

{

     // start bash, not the mintty, or you'll get a new window
  "terminal.integrated.shell.windows": "C:\cygwin64\bin\bash.exe",
  // Use this to keep bash from doing a 'cd ${HOME}'
  "terminal.integrated.env.windows": {
    "CHERE_INVOKING": "1"
  },
  // Make it a login shell
  "terminal.integrated.shellArgs.windows": [
    "-l"
  ],
    
}

printing : ${env:Path} do print all the windows PATH value including
C:cygwin64homemybin
and i added the actual path where ruby installed which is :
C:cygwin64bin

no matter what i still getting :

Debugger terminal error: Process failed: spawn rdebug-ide.bat ENOENT 

what do i miss here ?
Thanks

Your environment

  • vscode-ruby version: letest
  • Ruby version: 2.6.4p104
  • Ruby version manager (if any):
  • VS Code version: 1.55.2
  • Operating System:windows 10
  • Using language server? no

Expected behavior

working debuger

Actual behavior

getting :

Debugger terminal error: Process failed: spawn rdebug-ide.bat ENOENT 

im trying to making ruby installed in Cygwin to work , i successfully installed ruby and and ruby-devel in cygwin .
Started visual studio code from Cygwin and its working fine
my launch.json configuration : ( taken from several SOF suggestions )

"version": "0.2.0",
    
    "configurations": [
        {
            
            "name": "Debug Local File",
            "type": "Ruby",
            "request": "launch",
            "cwd": "${workspaceFolder}",
            "program": "${workspaceFolder}/test.rb",
            "env": {
                "Path": "${env:Path};C:\cygwin64\bin;/home/my/.gem" ,
                "GEM_HOME": "/home/my/.gem",
                "GEM_PATH": "/home/my/.gem",
                "RUBY_VERSION": "2.6.4p104"
            },
            "showDebuggerOutput": true,
           
            "args": [
                "server"
            ]
        }
    ]
}

my workspace settings.json config:

{

     // start bash, not the mintty, or you'll get a new window
  "terminal.integrated.shell.windows": "C:\cygwin64\bin\bash.exe",
  // Use this to keep bash from doing a 'cd ${HOME}'
  "terminal.integrated.env.windows": {
    "CHERE_INVOKING": "1"
  },
  // Make it a login shell
  "terminal.integrated.shellArgs.windows": [
    "-l"
  ],
    
}

printing : ${env:Path} do print all the windows PATH value including
C:cygwin64homemybin
and i added the actual path where ruby installed which is :
C:cygwin64bin

no matter what i still getting :

Debugger terminal error: Process failed: spawn rdebug-ide.bat ENOENT 

what do i miss here ?
Thanks

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Debugger error client error read econnreset
  • Debugger cortex m error no target connected
  • Debug thread error zennoposter
  • Debug server crashed due to an unknown error
  • Debug run time error 4 array index out of bounds

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии