RubyMine 2017.1 Help

Remote Debugging

RubyMine provides the possibility of remote debugging for Ruby and Rails applications, using the dedicated Ruby remote debug configuration. So doing, RubyMine keeps mapping between the local sources, and the sources on the server side.

Several debug processes can be launched simultaneously. So doing, each remote debug process starts in a separate tab in the Debug tool window, with the name Remote debug for <script name>. You can work with each debugging session as usual.

To debug a script or an application remotely, follow these general steps

  1. Start remote debug session.

    The common format of the command to be run on the remote host is as follows:

    rdebug-ide --host --port <port number> --dispatcher-port <port number> -- $COMMAND$

    You can see this command as a tip in the Ruby remote run/debug configuration dialog.

    Note that there is a difference between a Ruby script and a Rails application. For example, the command for a Ruby script will be:

    rdebug-ide --host --port 1234 --dispatcher-port 26162 -/home/user/RubymineProjects/remote-debug-example/math_wiz.rb

    The command for a Rails application will be:

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

    In both cases port is the port number on the remote host. dispatcher-port is the port number on the local host.

  2. Create local copy of the script or application to be debugged, and then set the required breakpoints.
  3. Create or edit Ruby remote debug configuration. For example,
  4. In RubyMine, select the desired Ruby remote debug configuration, open Ruby script or Rails application in the editor, and click /help/img/idea/2017.1/debug.png on the main toolbar.

Note that a cancel button has been added to the Connecting to debugger progress bar, giving you the way to manually cancel remote debugging session, rather than waiting for a timeout.

See the detailed instructions in the tutorial.

See Also

Language and Framework-Specific Guidelines:

Last modified: 18 July 2017