Vscode-ruby: WSL Documentation

Created on 17 Sep 2016  路  6Comments  路  Source: rubyide/vscode-ruby

Hi,

Wonderful repo you have. Been reading over source and docs to understand what's going and it's been easy to understand.

I'm a fairly new user to WSL (Windows Subsystem for Linux) and wanted to get VSCode (installed in Windows) playing nicely with ruby installation in Bash on Windows. I feel like I could follow https://github.com/rubyide/vscode-ruby/wiki/3.-Attaching-to-a-debugger but I'm not 100% sure how to translate the steps.

Would you consider adding a specific tutorial, instructions, or example config for using WSL ruby installation and VS Code (installed on windows)?

Thanks

feature-request

Most helpful comment

I've been able to make some basic progress on using the remote debugger but no luck on the autocomplete.

My script is as follows:

# main.rb
puts 'helloworld'
x = 123
puts 'abcd'
puts x
x = 456 # breakpoint here
x = 789
puts x
puts 'ddd'

In the terminal, I run the following command with the following output:

wasd@DESKTOP-KIQSRF6:/mnt/c/Users/wasd/Programs/99oop$ rdebug-ide --host 127.0.0.1 --port 3001 main.rb
Fast Debugger (ruby-debug-ide 0.6.0, debase 0.2.1, file filtering is supported) listens on 127.0.0.1:3001

I then run the command in WSL which has the following configuration:

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

After clicking play, in VS Code, exits the command and outputs the following:

abcd
123
789
ddd

It doesn't appear to be stopping at the breakpoint but ignoring it. Any advice would be appreciated.

All 6 comments

I've been able to make some basic progress on using the remote debugger but no luck on the autocomplete.

My script is as follows:

# main.rb
puts 'helloworld'
x = 123
puts 'abcd'
puts x
x = 456 # breakpoint here
x = 789
puts x
puts 'ddd'

In the terminal, I run the following command with the following output:

wasd@DESKTOP-KIQSRF6:/mnt/c/Users/wasd/Programs/99oop$ rdebug-ide --host 127.0.0.1 --port 3001 main.rb
Fast Debugger (ruby-debug-ide 0.6.0, debase 0.2.1, file filtering is supported) listens on 127.0.0.1:3001

I then run the command in WSL which has the following configuration:

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

After clicking play, in VS Code, exits the command and outputs the following:

abcd
123
789
ddd

It doesn't appear to be stopping at the breakpoint but ignoring it. Any advice would be appreciated.

Any docs at all on wsl integration would be appreciated.
"Fully tested against *nix/Windows and Ruby 1.9.3 to 2.2.0" means Windows WSL ?

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

@wingrunr21 It's still an issue but I've moved on and am no longer using WSL. I've returned to using Ubuntu as my daily driver.

Thanks for letting me know!

I noticed that you should set remoteWorkspaceRoot as WSL path (e.g. /mnt/c/Users/wasd/Programs/99oop), since "${workspaceRoot}" represents Windows path which is not vaild path under WSL.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rebornix picture rebornix  路  3Comments

SerkanOruc picture SerkanOruc  路  5Comments

chrisnicola picture chrisnicola  路  5Comments

archfish picture archfish  路  5Comments

rachsmithcodes picture rachsmithcodes  路  5Comments