【问题标题】:Remote debugging Rails application using RubyMine使用 RubyMine 远程调试 Rails 应用程序
【发布时间】:2017-05-23 23:51:33
【问题描述】:

我正在按照 Remote debugging article published by JetBrains 使用 RubyMine 调试远程 Rails 应用程序。

根据说明,我应该运行

rdebug-ide --port 1236 --dispatcher-port 26166 --host 0.0.0.0 ? bin/rails s -b 0.0.0.0

在远程主机上。运行上述命令会抛出以下错误消息,说明选项 -b 无效。

-bash-4.1$ rdebug-ide --port 1236 --dispatcher-port 26166 --host 0.0.0.0  bin/rails s -b 0.0.0.0 
    Using ruby-debug-base 0.2.1 Usage: rdebug-ide is supposed to be called from RDT, NetBeans, RubyMine, or
               the IntelliJ IDEA Ruby plugin.  The command line interface to
               ruby-debug is rdebug.

        Options:
            -h, --host HOST                  Host name used for remote 

debugging
        -p, --port PORT                  Port used for remote debugging
            --dispatcher-port PORT       Port used for multi-process debugging dispatcher
            --evaluation-timeout TIMEOUT evaluation timeout in seconds (default: 10)
            --stop                       stop when the script is loaded
        -x, --trace                      turn on line tracing
        -l, --load-mode                  load mode (experimental)
        -d, --debug                      Debug self - prints information for debugging ruby-debug itself
            --xml-debug                  Debug self - sends information <message>s for debugging ruby-debug itself
        -I, --include PATH               Add PATH to $LOAD_PATH
            --attach-mode                Tells that rdebug-ide is working in attach mode
            --keep-frame-binding         Keep frame bindings
            --disable-int-handler        Disables interrupt signal handler
            --rubymine-protocol-extensions
                                         Enable all RubyMine-specific incompatible protocol extensions
            --catchpoint-deleted-event   Enable chatchpointDeleted event
            --value-as-nested-element    Allow to pass variable's value as nested element instead of attribute

    Common options:
        -v, --version                    Show version

    invalid option: -b
  • RubyMine 2017.1 版
  • 远程主机操作系统:Centos-6.9
  • Ruby 版本:2.3.1p112

您能帮我了解一下出了什么问题吗?谢谢。

【问题讨论】:

    标签: ruby-on-rails ruby rubymine


    【解决方案1】:

    您使用的命令似乎不正确。应该是:

    rdebug-ide --port 1236 --dispatcher-port 26166 --host 0.0.0.0 -- bin/rails s -b 0.0.0.0
    

    您在 bin/rails 之前缺少双破折号。

    错误表明 b 选项对 rdebug-ide 命令无效。但是,b 选项适用于 bin/rails s 命令。

    【讨论】:

    • 也不适用于破折号。同样的错误“无效选项:-b”。
    • 我尝试了双破折号。当本地调试器连接到当前目录并且失败时,它试图在当前目录中加载文件。 -bash-4.1$ rdebug-ide --port 1236 --dispatcher-port 26166 --host 0.0.0.0 ? -- bin/rails s -b 0.0.0.0 快速调试器(ruby-debug-ide 0.6.1.beta4,debase 0.2.1,支持文件过滤)监听 0.0.0.0:1236 未捕获的异常:无法加载此类文件 - - 你能告诉我它在期待什么吗?请原谅我的无知,因为我是 Rails 的新手。谢谢。
    • 能否提供异常详情?
    • 应该有一个“?”还在双破折号之前?如果我忽略“?”,我仍然会收到相同的错误(无效选项 -b)。但是,如果我使用以下命令 rdebug-ide --port 1236 --dispatcher-port 26166 --host 0.0.0.0 ? -- bin/rails s -b 0.0.0.0 它启动但是当调试器连接时,它抛出异常 Uncaught exception: cannot load such file -- /vagrant/abc/webservices/xyz/? /var/imno/external/bin/rdebug-ide:23:in load' /var/mno/external/bin/rdebug-ide:23:in
      ' 我猜它正在尝试从当前目录加载一些文件,但它失败了
    猜你喜欢
    • 2017-02-07
    • 1970-01-01
    • 1970-01-01
    • 2011-12-07
    • 2013-11-17
    • 2016-04-23
    • 2014-02-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多