ruby/vscode-rdbg

Can't open a file with a space in the path (such as any file in iCloud)

agodoroja opened this issue · 2 comments

When trying to debug a file that is in iCloud, I get an error something like:

can't open file '/Users/XXX/Library/Mobile'

That is because iCloud files are stored in a folder with the path "/Users/XXX/Library/Mobile Documents/comappleCloudDocs". The file "launch.json" contains:

{
  "name": "Debug Local File",
  "type": "rdbg",
  "request": "launch",
  "script": "${file}"
}

Removing the "script" line, which is supposed to default to the currently open file, doesn't work either.

I have the same problem where specifying any script path containing a space fails to launch correctly

{
      "name": "Debug cost",
      "type": "rdbg",
      "request": "launch",
      "script": "C:/Users/Brad/Documents/src/Power Costs/calculate-usage-cost.rb",
      "args": ["-y", "202302"]
}
ruby: No such file or directory -- C:/Users/Brad/Documents/src/Power (LoadError)

The path continues after the space character following Power & will launch as expected without spaces.

It will work if you add quotes to the script path to enclose the path as a single var