Как настроить рубин на рельсах отладчик, используя против расширения кода для WSL


April 2019


317 раз


Я установил рубин на рельсах на WSL с окнами VS кода как редактор. Чтобы использовать Ruby - отладчик с Vs кода я установил на Ruby Extension. но он дает Extension host terminated unexpectedlyошибку. Как установить интерпретатор Путь для Ruby?

1 ответы


1) Ruby

VSCode will call Ruby provided it can already be found on your path as part of your standard environment. To test this, at the command line run;

ruby --version

It should return something like;

ruby 2.5.1p57...

If you get an error instead, then you need to check how Ruby is set up on your system

2) Install debugging gems

  • On the command line, run;

    gem install bundler nokogiri ruby-debug-ide debase

3) Set up VSCode Ruby debugging.

By default, VSCode assumes you have created the VSCode workspace in the root directory of your app, and the app's start point is main.rb . Assuming this is true, configure debugging in VSCode as follows;

  • Click the debug icon in Activity Bar on left
  • Click green play icon beside “DEBUG” in top left
  • Select “Ruby” from presented environment list
  • To right of debug play button, click the down arrow beside “Debug Local File” and change to “Listen for rdebug-ide”
  • Push gear button to right of the just selected "Listen for rdebug-ide"
  • Edit "Listen for rdebug-ide" section of the presented launch.json file to include;

    "showDebuggerOutput" : true

4) Hopefully, you are now be good to go. :)