Search code examples
debuggingrubymine

RubyMine 5.4 debugger times out, but debug console shows connected


I have a twist on the much-asked "how to get rubymine debugging to work" on a rails project. Selecting "Run/Debug 'myproject'" in RubyMine pops up a dialog titled "connecting to the debugger" which supposedly fails 10 seconds later (timeout). However, In the debug console, there is an informational message which changes from "(i) Disconnected" to "(i) Connected" as soon as I invoke Run/Debug. After the timeout, this changes back to "(i) Disconnected" Is the connection actually happening but RubyMine doesn't know?

Edit: I should note that I am able to connect to a debug server (rdebug-ide) started manually outside of RubyMine, and my computer system (Mac OS X) has a name, and that no errors are displayed in the console....RubyMine just doesn't connect when it starts the debug server itself automatically.


Solution

  • Solved! My hostname was inexplicably set to "localhost". I changed it on the command line to be something else via

    sudo hostname new-name
    

    and the RubyMine debugger now connects and starts up immediately. Google indicates that having a hostname return "localhost" is a common Mac OS X condition. I would like to suggest to the JetBrains team to make a check for this and issue a warning notification to the user to avoid such problems on Mac OS X in the future. Or just to rewrite the internal debugger connection code so as not to be impacted by this condition. Thanks to CrazyCoder for the suggestions.