在VSCode中debuggingRuby代码时出错(Mac OS X)

我想弄清楚这个新的Visual Studio代码(VSCode)编辑器,同时也学习Ruby。 每当我尝试debugging一个简单的ruby程序(甚至是Hello World)时,我收到以下错误VSCode

错误:无法在debugging模式下启动“节点”

这是我的terminal显示的内容:

/Users/Chixco/Documents/RubyProjects/FirstApp/test.rb:1 (function (exports, require, module, __filename, __dirname) { puts "Hello!" ^^^^^^^^ SyntaxError: Unexpected string at exports.runInThisContext (vm.js:73:16) at Module._compile (module.js:443:25) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.runMain [as _onTimeout] (module.js:501:10) at Timer.listOnTimeout (timers.js:110:15) 

这是我如何configuration我的launch.json文件:

 { "version": "0.1.0", // List of configurations. Add new configurations or edit existing ones. // ONLY "node" and "mono" are supported, change "type" to switch. "configurations": [ { // Name of configuration; appears in the launch configuration drop down menu. "name": "Launch test.rb", // Type of configuration. Possible values: "node", "mono". "type": "node", // Workspace relative or absolute path to the program. "program": "test.rb", // Automatically stop program after launch. "stopOnEntry": true, // Command line arguments passed to the program. "args": [], // Workspace relative or absolute path to the working directory of the program being debugged. Default is the current workspace. "cwd": ".", // Workspace relative or absolute path to the runtime executable to be used. Default is the runtime executable on the PATH. "runtimeExecutable": null, // Environment variables passed to the program. "env": { } }, { "name": "Attach", "type": "node", // TCP/IP address. Default is "localhost". "address": "localhost", // Port to attach to. "port": 5858 } ] } 

有谁知道是什么原因造成的?

PS当我在Eclipse中使用我的Aptana Studio插件时,我没有任何问题。

Visual Studio Code Preview不支持debuggingRuby。 如果你想在将来的VSCode版本中看到这个function,你可以在这里投票。 在上面的启动configuration中,你已经尝试configuration“node”来运行你的ruby程序(这是不能工作的)。

来源:我是Visual Studio代码团队的成员。

由于VS Code已经公开了debuggingAPI并允许我们自定义,所以我们可以轻松地创build一个rubydebugging器。

目前我正在研究VS Code Ruby Debugger ,你可以从marketplace下载。 它还在进行中,非官方的。