ruby - 如何使用 Intellij 12.1.7 调试 Ruby 2.1.1p76

标签 ruby debugging intellij-idea rubymine

如何使用 Intellij 12.1.7 调试 Ruby 2.1.1p76?我可以很好地运行我的脚本,但是当我单击调试按钮时,我会看到一个对话框:

The gem ruby-debug-base required by the debugger is not currently installed. Would you like to install it?

当我点击"is"时,我得到了这个:

10:36:21 AM Error running e2e
            Failed to Install Gems. Following gems were not installed:
            linecache (0.46):  Error installing linecache:
            ERROR: Failed to build gem native extension.      /home/jared/.rvm/rubies/ruby-2.1.1/bin/ruby extconf.rb Can't handle 1.9.x yet *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers.  Check the mkmf.log file for more details.  You may need configuration options.  Provided configuration options:   --with-opt-dir  --without-opt-dir   --with-opt-include  --without-opt-include=${opt-dir}/include    --with-opt-lib  --without-opt-lib=${opt-dir}/lib    --with-make-prog    --without-make-prog     --srcdir=.  --curdir    --ruby=/home/jared/.rvm/rubies/ruby-2.1.1/bin/ruby  extconf failed, exit code 1  Gem files will remain installed in /home/jared/.rvm/gems/ruby-2.1.1@global/gems/linecache-0.46 for inspection. Results logged to /home/jared/.rvm/gems/ruby-2.1.1@global/extensions/x86_64-linux/2.1.0/linecache-0.46/gem_make.out
            /home/jared/.IntelliJIdea12/config/plugins/ruby/rb/gems/ruby-debug-base-0.10.5.rc1.gem:  Error installing ruby-debug-base-0.10.5.rc1.gem:
            ERROR: Failed to build gem native extension.      /home/jared/.rvm/rubies/ruby-2.1.1/bin/ruby extconf.rb Can't handle 1.9.x yet *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers.  Check the mkmf.log file for more details.  You may need configuration options.  Provided configuration options:   --with-opt-dir  --without-opt-dir   --with-opt-include  --without-opt-include=${opt-dir}/include    --with-opt-lib  --without-opt-lib=${opt-dir}/lib    --with-make-prog    --without-make-prog     --srcdir=.  --curdir    --ruby=/home/jared/.rvm/rubies/ruby-2.1.1/bin/ruby  extconf failed, exit code 1  Gem files will remain installed in /home/jared/.rvm/gems/ruby-2.1.1@global/gems/linecache-0.46 for inspection. Results logged to /home/jared/.rvm/gems/ruby-2.1.1@global/extensions/x86_64-linux/2.1.0/linecache-0.46/gem_make.out

我知道我可以升级到 Intellij 13 来解决这个问题,但我不想这样做。

最佳答案

您可以使用 Ruby 远程调试。

  1. 安装 rdebug-ide:

    gem install ruby-debug-ide --pre
    
  2. 在 IDEA 中创建“Ruby 远程调试”配置

  3. 从终端运行脚本:

    rdebug-ide --port 1234 --dispatcher-port 26162 -- yourscript.rb
    
  4. 在IDEA中按“调试”

关于ruby - 如何使用 Intellij 12.1.7 调试 Ruby 2.1.1p76,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22995176/

相关文章:

ruby - Rails 3 的 API 错误自定义,例如 Github api v3

Ruby 找不到新版本的 OpenSSL

mysql - 使用 ruby​​ on rails 和 mysql 运行迁移

java - mvn 测试失败,但如果按包运行则测试通过

ruby-on-rails - 如何从 gem 扩展一个类?

.net - 调试 WCF 时无法自动进入服务器

java - 仅执行一个周期的摆模拟

macos - F6 快捷方式在 IntelliJ IDEA 和 MacOS X 上不起作用?

java - 在 IntelliJ IDEA 中初始化 SpringBoot 2 应用程序时出现 NoClassDefFoundError

javascript - 元素中生效的神秘属性