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 an application remotely, follow these general steps
- Perform preliminary steps:
- If necessary, create or edit Ruby remote debug configuration. Specify the remote host, and port number; define local and remote root folders.
- Make sure the required breakpoints are set.
- Launch the debug server. To do that, type the following command on the server side:
and then press Enter. Here
rdebug-ide --port <port number> -- $COMMAND$
<port number>is taken from the Port field of the Ruby remote debug configuration dialog box, and
$COMMAND$is the name of the script or application we debug.
For example, to remotely debug a Rails application, run the following command on the remote host:
rdebug-ide --port 1234 --dispatcher-port 26162 -- bin/rails s
Also make sure that the gem
ruby-debug-ideis bundled to the project.
- In RubyMine, select the desired Ruby remote debug configuration, open Ruby script in the editor, and click on the main toolbar.