1. 远程监听
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 . You can work with each debugging session as usual.
The common format of the command to be run on the remote host is as follows:
rdebug-ide --host 0.0.0.0 --port --dispatcher-port -- $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 0.0.0.0 --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 0.0.0.0 - bin/rails s -b 0.0.0.0
In both cases port is the port number on the remote host.dispatcher-port is the port number on the local host.
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.
2. 端口转发
rubymine debug 80端口
sudo ssh -t -L 80:127.0.0.1:8080 user@0.0.0.0
3. nginx 转发