I can't get my ruby-debug-ide to work properly. I have a basic rails app, and I would like to debug in RubyMine. Before I even start RubyMine, I need to enable rdebug-ide in my vagrant VM. When I navigate to my project directory, I have read online I need to enter the following command:
rdebug-ide --port 1236 --dispatcher-port 26166 --host 0.0.0.0 - bin/rails s -b 0.0.0.0
However when I run this command, I get this message:
I have also tried a modified version of the above command: (an extra dash)
rdebug-ide --port 1236 --dispatcher-port 26166 --host 0.0.0.0 -- bin/rails s -b 0.0.0.0
And I get this as a result: This looks good at first, but then the server never starts. It never displays the server info and it just sits here and hangs until I CTRL+C out of the server. I can't get the rdebug-ide to work in conjunction with rails. Does anyone know how I can fix this?
I believe you should add the command to the Ruby Remote Debug Configuration inside of RubyMine.
Run > Edit Configurations > Add Ruby remote debug
configuration.I've got RubyMine remote debugging to work :-)
Before you start, be sure you have debase and rdebug-ide installed:
1. Start Rails server
First of all, you need to start the Rails server:
For your reference, my Ruby, Rails and Ubuntu versions are:
As you noticed, the server seems never starting. It just hangs there. This is actually correct. It hangs there, waiting to be connected, from RubyMine for example.
2. Remote debug from RubyMine
Now start RubyMine (I'm using RubyMine 2017.2.4), Run -> Debug... -> Edit Configurations...
Click plus sign '+' to add new configuration, and choose Ruby remote debug.
Fill the form and click the Debug button. Immediately the server does no longer hang there, and the Rails server gets started:
Finally, you can set breakpoints in RubyMine, and start remote debugging :-)
in my case I had to replace
-- bin/rails
with relative path:-- ../../../../../usr/local/bin/rails
, because once I pressedCTRL+c
I saw the message stating/usr/src/app/bin/rails
was not found.