Remote debugging JRuby application in Vagrant

I've tried to setup remote debugging on JRuby but to no avail. The command I get from RubyMine is the following:

rdebug-ide --port 31337 --dispatcher-port 31338 -- $SCRIPT$

However, when I run it inside of Vagrant (with my script), I get the help screen for rdebug-ide and it doesn't show a --dispatcher-port option available:

$ rdebug-ide --port 31337 --dispatcher-port 31338 -- jruby --server -J-Xmx1000m  --debug -- script/transweb -p 38000 -e development

Using ruby-debug-base 0.10.3.2
Usage: rdebug-ide is supposed to be called from RDT, NetBeans or RubyMine. The
       command line interface to ruby-debug is rdebug.

Options:
....
</snip>

What's strange is that I've 'ruby-debug-base (0.10.4 java)' in the 'global' gemset but when I run rdebug-ide, it seems to be using 'ruby-debug-base 0.10.3.2'.

Environment details

Vagrant

$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.4.1
  - RUBY VERSION: 1.8.7 (2012-05-01 patchlevel 357) [java]
  - INSTALLATION DIRECTORY: /usr/local/rvm/gems/jruby-1.6.7.2@app
  - RUBY EXECUTABLE: /usr/local/rvm/rubies/jruby-1.6.7.2/bin/jruby
  - EXECUTABLE DIRECTORY: /usr/local/rvm/gems/jruby-1.6.7.2@app/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-java-1.6
  - GEM PATHS:
     - /usr/local/rvm/gems/jruby-1.6.7.2@app
     - /usr/local/rvm/gems/jruby-1.6.7.2@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "install" => "--no-rdoc --no-ri"
     - "update" => "--no-rdoc --no-ri"
  - REMOTE SOURCES:
     - http://rubygems.org/

$ gem list | grep debug
ruby-debug (0.10.4)
ruby-debug-base (0.10.4 java)
ruby-debug-ide (0.4.16)

$ jruby -v
jruby 1.6.7.2 (ruby-1.8.7-p357) (2012-05-01 26e08ba) (Java HotSpot(TM) Server VM 1.6.0_31) [linux-i386-java]

$ rdebug-ide -v
Using ruby-debug-base 0.10.3.2

$ lsb_release -a
Distributor ID:    Debian
Description:    Debian GNU/Linux 6.0.5 (squeeze)
Release:    6.0.5
Codename:    squeeze

$ uname -a
Linux v-2f2691 2.6.32-5-amd64 #1 SMP Sun May 6 04:00:17 UTC 2012 x86_64 GNU/Linux

Shared ports:
31337 -> 31337
31338 -> 31338

Local
$ sw_vers
ProductName:    Mac OS X
ProductVersion:    10.7.4
BuildVersion:    11E53

RubyMine Version: 4.5.4

3 comments
Comment actions Permalink

Looks like you're not correctly specifying script. Script is supposed to be Ruby script, not any executable.
rdebug-ide --port 31337 --dispatcher-port 31338 -- script/transweb -p 38000 -e development
and if you want to specify additional jruby arguments you can do it like that:
jruby --server -J-Xmx1000m  --debug `which rdebug-ide` --port 31337 --dispatcher-port 31338 -- script/transweb -p 38000 -e development

0
Comment actions Permalink

This is the output from the above command when I run it:

$ jruby --server -J-Xmx1000m  --debug `which rdebug-ide` --port 31337 --dispatcher-port 31338 -- script/transweb -p 38000 -e development
Using ruby-debug-base 0.10.3.2
Usage: rdebug-ide is supposed to be called from RDT, NetBeans or RubyMine. 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

invalid option: --dispatcher-port

0
Comment actions Permalink

Version or ruby-debug-ide you're using does not understand --dispatcher-port argument. You can either upgrade it with gem install ruby-debug-ide --pre, or skip this argument with the following port

0

Please sign in to leave a comment.