我刚刚遇到了Shopify.ruby-lsp vscode 扩展,它与VSCode RDBG一起使用。我一直在使用 rebornix.Ruby / vscode-ruby 扩展和 ruby-debug-ide;Stafford Brunk(wingrunr21,vscode-ruby 的开发者)正在请求其他人接管该项目。
了解 Shopify 为 Ruby 编程提供的各种包与其他包的比较会很有帮助。我不太担心功能级别的比较,现在,我只想知道非常基本的问题的答案,例如:
Shopify.ruby-lsp / VSCode RDBG 解决了多少 rebornix vscode-ruby / vscode-solargraph / ruby-debug-ide 问题?换句话说,我可以更换部分或全部其他内容并使用 Shopify.ruby-lsp 达到相同目的吗?
还有哪些其他软件包可能与 Shopify.ruby-lsp 冲突,应该禁用或删除?
我已经安装了 debase,但是当我尝试 gem install ruby-debug-ide 时,它仍然无法构建 gem 本机扩展:
ERROR: Error installing ruby-debug-ide-0.6.1.beta2.gem:
ERROR: Failed to build gem native extension.
C:/Ruby22-x64/bin/ruby.exe mkrf_conf.rb
Installing base gem
Unable to resolve dependency: user requested 'debase (> 0)'
C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/resolver.rb:439:in `resolve_for_zero'
C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/resolver.rb:350:in `resolve_for'
C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/resolver.rb:196:in `resolve'
C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/request_set.rb:358:in `resolve'
C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/dependency_installer.rb:473:in `resolve_dependencies'
C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/dependency_installer.rb:373:in `install'
mkrf_conf.rb:35:in `rescue in <main>'
mkrf_conf.rb:28:in `<main>'
rake failed, exit code 1
Gem files will remain installed in C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/ruby-debug-ide-0.6.1.beta2 for inspection.
Results logged to C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/ruby-debug-ide-0.6.1.beta2/gem_make.out`}
Run Code Online (Sandbox Code Playgroud)
我确实安装了debase。
*** LOCAL GEMS ***
actioncable (5.0.0.1)
actionmailer (5.0.0.1)
actionpack (5.0.0.1) …Run Code Online (Sandbox Code Playgroud) 我已ruby-debug-ide在 Visual Studio Code 中完成远程调试(我正在使用 Docker)的所有设置。docker-compose.yml我在启动ruby-debug-ide和 Rails 服务器中使用此命令:
rm -f /api/tmp/pids/server.pid && rdebug-ide --host 0.0.0.0 --port 1234 -- bin/rails server --port=3000 --binding=0.0.0.0
Run Code Online (Sandbox Code Playgroud)
然后在 vscode 中我有这个 launch.json 脚本:
{
"name": "Listen for rdebug-ide",
"type": "Ruby",
"request": "attach",
"cwd": "${workspaceRoot}",
"remoteHost": "127.0.0.1",
"remotePort": "1234",
"remoteWorkspaceRoot": "/app",
"showDebuggerOutput": true
}
Run Code Online (Sandbox Code Playgroud)
当我转到 vscode 并启动 launch.json 脚本时,我的 Rails 服务器以及调试器都会启动。但是当我停止/分离 launch.json 脚本时,rails 服务器崩溃了。
有没有办法独立启动我的 Rails 服务器ruby-debug-ide?我希望在不进行调试时能够访问我的 Rails 应用程序。是否可以做这样的事情:
# start my rails server
rm …Run Code Online (Sandbox Code Playgroud) ruby ruby-on-rails ruby-debug-ide visual-studio-code vscode-debugger
我无法让我的 ruby-debug-ide 正常工作。我有一个基本的 Rails 应用程序,我想在 RubyMine 中进行调试。在启动 RubyMine 之前,我需要在我的 vagrant VM 中启用 rdebug-ide。当我导航到我的项目目录时,我已经在线阅读,我需要输入以下命令:
rdebug-ide --port 1236 --dispatcher-port 26166 --host 0.0.0.0 - bin/rails s -b 0.0.0.0
Run Code Online (Sandbox Code Playgroud)
我还尝试了上述命令的修改版本:(额外的破折号)
rdebug-ide --port 1236 --dispatcher-port 26166 --host 0.0.0.0 -- bin/rails s -b 0.0.0.0
Run Code Online (Sandbox Code Playgroud)
我得到的结果是:
乍一看这看起来不错,但是服务器永远不会启动。它从不显示服务器信息,它只是坐在这里并挂起,直到我按 CTRL+C 退出服务器。我无法让 rdebug-ide 与 Rails 结合使用。有谁知道我该如何解决这个问题?