How exactly are we supposed to use remote debug?
There's even some sort of tutorial on this matter (https://confluence.jetbrains.com/display/RUBYDEV/How+to+setup+and+run+ruby+remote+debug+session), but it's hard to follow as there's a couple of details missing:
- how are we supposed to start up our Rails/etc server? Is it run separately from the rdebug command, or should rdebug start the server for us? There are a couple of abandoned questions[1][2] with the same doubts, no replies.
- what's the relation of that $COMMAND$ with the way we boot our remote web server? I've tried several commands for my Padrino app and many fail.
- what are local/dispatcher ports exactly? Do they have any relation with my web server's port?
This is what happens to me:
- I have a docker-compose environment where my Padrino app is started by the following command: "bundle install && bundle exec foreman start". Foreman then runs "bundle exec padrino s -p $PORT".
- I've opened ports 5000 (where my web server runs), 5999 and 26162 on the server container.
- I have a single Ruby Remote Debug configured, and the command it tells me to run on my server is: "rdebug-ide --host 0.0.0.0 --port 5999 --dispatcher-port 26162 -- $COMMAND$"
- I added ruby-debug-ide and debase to my Gemfile
1. I tried entering the active container (I can see my site running on localhost:5000) and run it, as follows:
# bundle exec rdebug-ide --host 0.0.0.0 --port 5999 --dispatcher-port 26162 -- bundle exec foreman start
Fast Debugger (ruby-debug-ide 0.6.0, debase 0.2.1, file filtering is supported) listens on 0.0.0.0:5999
Then I try to Run > Debug, but I get the error "Failed to find free socket port for process dispatcher".
2. If I press Ctrl+C on my container it seems it will kill rdebug but then execute my said $COMMAND$ in a different enviroment, as it says "Uncaught exception: cannot load such file -- /project/bundle" (being /project my project's root folder inside the container).
What's wrong here? What am I missing? Will someone from the support team FINALLY respond to such error?
[1]: https://intellij-support.jetbrains.com/hc/en-us/community/posts/206064469-remote-debugging-failed-to-find-free-socket
[2]: http://stackoverflow.com/questions/32638976/how-can-i-get-ruby-debug-ide-to-work
Please sign in to leave a comment.