Can't debug in RubyMine - Cannot connect to the debugged process in 10s

I can run Ruby and RoR projects. I just can't debug anything.

I have done my best to look at all similar posts and try to apply their solutions to my problem with no success.

I am getting the following when I try to debug:


Cannot connect to the debugged process in 10s:

Error Output:
/opt/local/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.6/bin/rdebug-ide:51: warning: already initialized constant ARGV
/opt/local/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.6/bin/rdebug-ide:82: undefined method `debug_program' for Debugger:Module (NoMethodError)
from -e:1:in `load'
from -e:1

I am running:

gem 1.3.4
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.4]
ruby-debug (0.10.3)

ruby-debug-base (0.10.3)
ruby-debug-ide (0.4.6)

RubyMine 1.1

Here is the console output:


/usr/bin/ruby -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift) /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.6/bin/rdebug-ide --port 54600 -- /Users/ed/Ruby/tester/t.rb

Process finished with exit code 1

Any help would be appreciated.

Thanks,

Ed.



 

 

0
25 comments
Avatar
Permanently deleted user

I'm having the exact same problem.

0
Avatar
Permanently deleted user

Hello Ed,

I can run Ruby and RoR projects. I just can't debug anything.


I have done my best to look at all similar posts and try to apply their solutions to my problem with no success.


I am getting the following when I try to debug:


Cannot connect to the debugged process in 10s:


Error Output:
/opt/local/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.6/bin/rdebug-ide:51: warning: already initialized constant ARGV
/opt/local/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.6/bin/rdebug-ide:82: undefined method `debug_program' for Debugger:Module (NoMethodError)
from -e:1:in `load'
from -e:1


I am running:


gem 1.3.4
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.4]
ruby-debug (0.10.3)


ruby-debug-base (0.10.3)
ruby-debug-ide (0.4.6)


RubyMine 1.1


Here is the console output:


/usr/bin/ruby -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift) /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.6/bin/rdebug-ide --port 54600 -- /Users/ed/Ruby/tester/t.rb


Process finished with exit code 1

Well let me ask you a couple of questions.
1. Please add idea.is.internal=true to file idea.properties in bin folder of your RubyMine installation folder. It will enable debug output for ruby debugger. Restart RubyMine and try another time. You'll get some rdebug debug info in console. Please attach it here.
2. Are you able to debug your application using rdebug from command line?

Regards,
Oleg

0
Avatar
Permanently deleted user

1) Here is the info (thanks for the clarification on the location of the idea.properties file. I saw a reference to it in another post but I had no idea where it was located) :

Cannot connect to the debugged process in 10s:

Standard Output:
Using ruby-debug-base 0.10.3
Usage: rdebug-ide is supposed to be called from RDT or NetBeans. The command line interface to ruby-debug is rdebug.

Options:
    -h, --host HOST                  Host name used for remote debugging
    -p, --port PORT                  Port used for remote debugging
        --stop                       stop when the script is loaded
    -x, --trace                      turn on line tracing
    -l, --load-mode                  load mode (experimental)
    -d, --debug                      Debug self - prints information for debugging ruby-debug itself
        --xml-debug                  Debug self - sends information <message>s for debugging ruby-debug itself
    -I, --include PATH               Add PATH to $LOAD_PATH
        --keep-frame-binding         Keep frame bindings

Common options:
    -v, --version                    Show version

undefined method `cli_debug=' for Debugger:Module
Error Output:
/opt/local/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.6/bin/rdebug-ide:51: warning: already initialized constant ARGV


2) I am not real familiar with rdebug in command line mode but it seems to work. I can run rdebug #{file_name} and use the Available commands.

Thanks for your assistance!


0
Avatar
Permanently deleted user

undefined method `cli_debug=' for Debugger:Module
Error Output:
/opt/local/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.6/bin/rdebug-ide:51: warning: already initialized constant ARGV

Could you please try RubyMine remote debug on localhost? Follow the instructions here: http://blogs.jetbrains.com/ruby/2009/05/ruby-remote-debug/
This will help us to determine if command line generated by RubyMine to launch debug server
/usr/bin/ruby -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift) /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.6/bin/rdebug-ide --port 54600 -- /Users/ed/Ruby/tester/t.rb
causes your problem.

Regards,
Oleg

0
Avatar
Permanently deleted user

Remote debug on localhost works!

0
Avatar
Permanently deleted user

Remote debug on localhost works!

Excellent!

/usr/bin/ruby -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift) /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.6/bin/rdebug-ide --port 54600 -- /Users/ed/Ruby/tester/t.rb

It seems we got the problem. Something weird has happened with your Ruby SDK and Gems settings. Seems that /usr/bin/ruby interpreter doesn't store its gems in /opt/local/lib/ruby/gems/1.8/gems
Please try remove SDKs installed and setup them one more time.

Hope this help,
Oleg

0
Avatar
Permanently deleted user

Oleg,
He may not have his ruby symlinked to the /usr/bin/  directory.  If you are using Ruby Enterprise then it is a requirement.  May be you want to check if that.  Here is a post by Peter Cooper which outines Ruby and Rails installation on Ubuntu.  He uses MRI, but I have used it with Ruby Enterprise successfully.  The symlinking part is important for Rubymine to work correctly:

http://www.rubyinside.com/how-to-install-a-ruby-18-stack-on-ubuntu-810-from-scratch-1566.html

Bharat

0
Avatar
Permanently deleted user

$ which gem
/opt/local/bin/gem

$ which ruby
/opt/local/bin/ruby


It does appear to be a RubyMine SDK settings issue. When I got RubyMine Preferences->Ruby SDK and Gems, click on Remove SDK next to Ruby interperter field and click Add SDK pointing to '/opt/local/bin/ruby', it works.

RubyMine wants to use '/usr/bin/ruby'. When I add an SDK, if I wait a bit RubyMine auto-populates the field with '/usr/bin/ruby'. I had to replace that value in the field with '/opt/local/bin/ruby' to get it to work.

I think most of my RoR stuff is in '/opt/local/' because I originally setup much of my RoR stuff via macports. I am regretting that a bit. The options were few when I got into this stuff.

Thanks for your help!

0

Hello Edwin,

RubyMine wants to use '/usr/bin/ruby'. When I add an SDK, if I wait a bit RubyMine auto-populates the field with '/usr/bin/ruby'. I had to replace that value in the field with '/opt/local/bin/ruby' to get it to work.


I think most of my RoR stuff is in '/opt/local/' because I originally setup much of my RoR stuff via macports. I am regretting that a bit. The options were few when I got into this stuff.

RubyMine looks for 'ruby' interpreter in your PATH env variable. Unfortunately Apple implement working with environment variables in a quite strage way. Terminal.app understands settings from ~/.profile and all other applications (including RubyMine) gets some other default standard env settings. E.g if you launch RubyMine from console it will have expected environment. Apple suggests to use  ~/.MacOSX/environment.plist for extending environment variables for Applications.
In RubyMine 1.0.5/1.1 we improved our ruby interpreter searcher and now it also looks in ~/.profile (for initializing first RubySDK).

0
Avatar
Permanently deleted user

I just had the same problem on Mac OS X.  Uninstalled ruby-debug and ruby-debug-ide.  Somehow ruby-debug-ide gem was corrupt and would not uninstall, so I removed it manually from the gems directory.  After re-installing both gems, rubymine started working again.

0

Andreas,

Thank your for the tip!

0
Avatar
Permanently deleted user

I've tried all of the above (except for remote debugging), but it didn't help... I'm still getting this error: Cannot connect to the debugged process in 10s. Then I gave up and downloaded NetBeans 6.8, and debugging works there out of the box.

Also I tried to increase the timeout value as suggested by the error message, but I couldn't find that option.

Please help, I will provide any additional information if needed...

The error message text is:

Cannot connect to the debugged process at port 59843 in 10s:
Dumping and destroying process, when the debuggee process is running. You might try to increase the timeout. Killing...
Error Output:
Fast Debugger (ruby-debug-ide 0.4.9) listens on :59843

My environment:

  • Mac OS Snow Leopard, version 10.6.3
  • Ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-darwin10] (installed through MacPorts!)
  • RubyGems version 1.3.5 also installed through MacPorts.
  • Installed gems:
  • actionmailer (2.3.5)
    actionpack (2.3.5)
    activerecord (2.3.5)
    activeresource (2.3.5)
    activesupport (2.3.5)
    builder (2.1.2)
    cgi_multipart_eof_fix (2.5.0)
    daemons (1.0.10)
    fastercsv (1.5.3)
    fastthread (1.0.7)
    ftpfxp (0.0.4)
    gem_plugin (0.2.3)
    httpclient (2.1.5.2)
    linecache (0.43)
    mocha (0.9.8)
    mongrel (1.1.5)
    mongrel_cluster (1.0.5)
    mysql (2.8.1)
    net-sftp (2.0.4)
    net-ssh (2.0.22)
    polyglot (0.3.1)
    rack (1.0.1)
    rails (2.3.5)
    rake (0.8.7)
    RedCloth (4.2.3)
    ruby-debug-base (0.10.3)
    ruby-debug-ide (0.4.9)
    soap4r (1.5.8)
    treetop (1.4.5)
    tzinfo (0.3.20)
    vpim (0.695)
    will_paginate (2.3.12)
    xml-simple (1.0.12)
    zipruby (0.3.6)
0
Avatar
Permanently deleted user

Still couldn't get it to work - tried everything... Could you please describe, how I could turn on debugger logging in RubyMine for Mac? I just coundn't understand what the real error is...

0
Avatar
Permanently deleted user

I just tried remote debugging on localhost, but it doesn't work as well: when in terminal I execute "rdebug-ide --port 1234 -- ./script/server" the command hangs. I htought that rdebug-ide waits for debugger to connect, but it doesn't - RubyMine debugger couldn't connect. I tried turing on all logging options and "idea.is.internal" - doesn't help. Process dumps are empty, idea.log has the same output as UI dialog:

Cannot connect to the debugged process at port 52912 in 30s:

Dumping and destroying process, when the debuggee process is running. You might try to increase the timeout. Killing...

Error Output:
Fast Debugger (ruby-debug-ide 0.4.9) listens on :52912


Please help

0

Hello Alex,

Probably your firewall blocks RubyMine attempt to establish connection. Please check it.

Unfortunately detailed logging of ruby-debug connection exception isn't enabled in RubyMine(will be fixed in next 2.5 EAP). But please try following:
1. Add "ruby.debug.output=true" in Info.plist
2. Launch RubyMine from console using /Applications/RubyMine-XXX/Contents/MacOS/rubymine

0
Avatar
Permanently deleted user

My default Mac Firewall is currently OFF - I checked. I do have a different Firewall application: LittleSnitch, but I also disabled it for testing.

I've added ruby.debug.output=true to Info.plist and into bin/idea.properties (this is where I was adding idea.is.internal = true before), then I've started RubyMine from Terminal:


localhost:benefits20100303 aliaksandrkaushovik$ /Applications/RubyMine\ 2.0.2.app/Contents/MacOS/rubymine
May 12, 2010 12:26:17 PM org.rubyforge.debugcommons.Util dumpStream
SEVERE: Error Output:
May 12, 2010 12:26:17 PM org.rubyforge.debugcommons.Util dumpStream
SEVERE: Fast Debugger (ruby-debug-ide 0.4.9) listens on :49429


The last idea.log entires are:

2010-05-12 12:25:40,206 [   6034]   INFO - tor.impl.FileEditorManagerImpl - Project opening took 3665 ms
2010-05-12 12:26:06,332 [  32160]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/runner.layout.xml file is null
2010-05-12 12:26:06,332 [  32160]   INFO - .impl.stores.XmlElementStorage - Document was not loaded for $APP_CONFIG$/runner.layout.xml
2010-05-12 12:26:17,998 [  43826]   INFO - debugger.impl.RubyDebugProcess - Couldn't connect to debugger: org.rubyforge.debugcommons.RubyDebuggerException: Cannot connect to the debugged process at port 49429 in 10s:

Dumping and destroying process, when the debuggee process is running. You might try to increase the timeout. Killing...

Error Output:
Fast Debugger (ruby-debug-ide 0.4.9) listens on :49429


The command RubyMine was using to launch the application:

/opt/local/bin/ruby -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift) /opt/local/bin/rdebug-ide --debug --port 49429 -- /Users/aliaksandrkaushovik/dev/benefits/script/server -p 3000 -b 0.0.0.0 -e development


Thread dumps folders where created, but they are empy (0 bytes).

Thank you,
Alex.

0

I've added ruby.debug.output=true to Info.plist

I missed -D prefix. Should be something like:


<key>VMOptions</key>
<string>-Xms16m -Xmx192m -XX:MaxPermSize=120m -Xbootclasspath/p:../lib/boot.jar -ea -Druby.debug.output=true -Didea.is.internal=true</string>


We can try to remotely debug your RubyMine, please write me at roman.chernyatchik at jetbrains.com.

0
Avatar
Permanently deleted user

I've replaced by VMOptions parameter in Info.plist and I got the same output:

May 12, 2010 1:07:07 PM org.rubyforge.debugcommons.Util dumpStream
SEVERE: Error Output:
May 12, 2010 1:07:07 PM org.rubyforge.debugcommons.Util dumpStream
SEVERE: Fast Debugger (ruby-debug-ide 0.4.9) listens on :51573


Thank you,
Alex.

0
Avatar
Permanently deleted user

The problem is finally resolved...

RubyMine has nothing to do with it!


I had "localhost" configured as a hostname of my system, which probably conflicted with loopback interface somehow (I'm not an expert in networs, so this is just a guess). Please don't ever set your hostname to "localhost"

Special thanks to Roman Chernyatchik - without his help the resolution would have been impossible or would have taken forever. I knew this was something small!

Thank you!
Alex Kovshovik.

Update: I thought I was an idiot, check this out: http://forums.macrumors.com/showthread.php?t=848067

0
Avatar
Permanently deleted user

Perhaps this may help too:

During upgrade to Mac OS X 10.6.8  a line

0.0.0.0  localhost

had been inserted into my /etc/hosts

I changed that line back to

127.0.0.1       localhost

and the debugger started in time again as it did before!

0
Avatar
Permanently deleted user

Gernot,  Huge!  This was driving me crazy.  Thanks for posting.

0
Avatar
Permanently deleted user

Running RubyMine 3.2.4, Ubuntu 10.10 running on Oracle VM VirtualBox, and Ruby 1.9.2p312 provided via RVM.

I'm having the same problem as others on this topic, and I believe I have tried all of the suggestions, but I still get error:

    Cannot connect to the debugged process at port 46679 in 10s

It wasn't clear if anyone replying to this topic was running Ubuntu under a VM?  Since it's a port issue, I'm wondering if maybe the VM is preventing RubyMine from hooking up with the debugger port?

My app is running fine without debugger - so I think it's most likely a debugger/RubyMine issue.

Thanks for any help!

--Bob

Here's my gem env:
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.10
  - RUBY VERSION: 1.9.2 (2011-08-11 patchlevel 312) [i686-linux]
  - INSTALLATION DIRECTORY: /home/bob/.rvm/gems/ruby-1.9.2-head
  - RUBY EXECUTABLE: /home/bob/.rvm/rubies/ruby-1.9.2-head/bin/ruby
  - EXECUTABLE DIRECTORY: /home/bob/.rvm/gems/ruby-1.9.2-head/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /home/bob/.rvm/gems/ruby-1.9.2-head
     - /home/bob/.rvm/gems/ruby-1.9.2-head@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

and Gem List:
activemodel (3.1.1 ruby)
activerecord (3.1.1 ruby)
activesupport (3.1.1 ruby)
akami (1.0.0 ruby)
archive-tar-minitar (0.5.2 ruby)
arel (2.2.1 ruby)
builder (3.0.0 ruby)
bundler (1.0.21 ruby)
cgi_multipart_eof_fix (2.5.0 ruby)
clio (0.3.0 ruby)
columnize (0.3.4 ruby)
crack (0.3.1, 0.1.8 ruby)
cucumber (1.1.1 ruby)
daemons (1.1.4 ruby)
dbi (0.4.5 ruby, 0.4.3 ruby)
deprecated (3.0.0 ruby, 2.0.1 ruby)
diff-lcs (1.1.3 ruby)
fakeweb (1.3.0 ruby)
fastthread (1.0.7 ruby)
gem_plugin (0.2.3 ruby)
gherkin (2.6.2 ruby)
git (1.2.5 ruby)
gyoku (0.4.4 ruby)
htmlentities (4.3.0 ruby)
httparty (0.8.1 ruby)
httpi (0.9.5 ruby)
i18n (0.6.0 ruby)
jeweler (1.6.4 ruby)
josephholsten-rets4r (1.1.18 ruby)
json (1.6.1 ruby)
linecache19 (0.5.12)
minitar (0.5.3 ruby)
minitest (2.7.0 ruby, 2.6.2)
multi_json (1.0.3 ruby)
multi_xml (0.4.1 ruby)
net-http-digest_auth (1.1.1 ruby)
net-sftp (2.0.5 ruby)
net-ssh (2.2.1 ruby)
nokogiri (1.5.0 ruby, 1.4.3.1 ruby)
nokogirl (1.0 ruby)
nori (1.0.2 ruby)
ntlm-http (0.1.1 ruby)
pg (0.11.0 ruby)
postgres-pr (0.6.3 ruby)
pyu-ntlm-http (0.1.3.1 ruby)
rack (1.3.5 ruby)
rake (0.9.3.beta.1, 0.9.2.2 ruby, 0.9.2 ruby)
rake-compiler (0.7.9 ruby)
rdiscount (1.6.8 ruby)
rdoc (3.11 ruby)
rets4r (1.1.18 ruby)
rspec (2.7.0 ruby)
rspec-core (2.7.1 ruby)
rspec-expectations (2.7.0 ruby)
rspec-mocks (2.7.0 ruby)
ruby-debug-base19 (0.11.25)
ruby-debug-base19x (0.11.29)
ruby-debug-ide (0.4.17.beta8 ruby, 0.4.16)
ruby-debug-ide19 (0.4.12)
ruby-debug19 (0.11.6)
ruby_core_source (0.1.5 ruby)
rubygems-update (1.8.11 ruby)
savon (0.9.7 ruby)
term-ansicolor (1.0.7 ruby)
test-unit (2.4.0 ruby)
tzinfo (0.3.30 ruby)
wasabi (2.0.0 ruby)
xml-simple (1.1.1 ruby)
zip (2.0.2 ruby)
zliby (0.0.5 ruby)

0
Avatar
Permanently deleted user

It sounds really familiar to what I had with my Mac.

What is in your /etc/hosts file? Your "loopback" interface (localhost) could be messed up.

Also if you are using VM, what kind of network configuration do you have for your VM?

0
Avatar
Permanently deleted user

Definately sounds like a network issue.  I would ping localhost see what ip comes up.  Also you can try and mess with the IP in the server configuration.  But I think as Alex said the place to start is the VM network adapters and the hosts file.

0
Avatar
Permanently deleted user

I did see that /etc/hosts topic, but I do have the connections 127.0.0.1 mapping.

Here's my /etc/hosts file (I have not modified it) - I am not sure exactly what's needed for a VM:

172.29.8.153    bob-VirtualBox    # Added by NetworkManager
127.0.0.1    localhost.localdomain    localhost
::1    bob-VirtualBox    localhost6.localdomain6    localhost6
127.0.1.1    bob-VirtualBox

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

Here's ping:
bob@bob-VirtualBox:~$ ping localhost
PING localhost.localdomain (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost.localdomain (127.0.0.1): icmp_req=1 ttl=64 time=0.480 ms



Thanks,

--Bob

0

Please sign in to leave a comment.