nixme/pry-nav

"next" performs a "step" in jruby

gregors opened this issue · 12 comments

"next" performs a "step" in jruby. Anyone have any pointers on how I might begin to tackle this?

I have the same - no difference between "next" and "step".
Checked on JRuby 1.7.3

Same for me with JRuby 1.7.x.

Had the same issue. Pass the --debug option to jruby to fix.

@camertron , could you give more details about how you are using the --debug option ? I followed the wiki page UsingTheJRubyDebugger and tried different things and combinations without success on a Rails project. Thanks.

Hey @jonathanpa, I'm not using pry-nav in a Rails project, maybe that's the difference? I'm running a plain ruby (jruby) command - it looks something like this in its entirety:

JRUBY_OPTS="-J-XX:MaxPermSize=128m..." CLASSPATH=vendor/scala-compiler-2.9.2.jar:... /usr/bin/env ruby --debug --1.9 my_script.rb

Note that I've used ellipses to indicate more parameters (those aren't actually part of the command). This seems to work for me - both "next" and "step" do what they're supposed to do. For Rails, I think it's just a matter of finding where ruby itself is invoked. Maybe try patching the shebang at the top of your script/rails file:

#!/usr/bin/env ruby --debug

I just tried this using bundler for a non-rails project. I modified the bundler bin to:

#!/usr/bin/env jruby --debug
#
# This file was generated by RubyGems.
#
# The application 'bundler' is installed as part of a gem, and
# this file is here to facilitate running it.
#

I have the same issue

Hmm this suddenly stopped working for me... I guess I'm in the same boat as you guys :(

I'm not sure whether you guys are cool with me linking to this issue – but I did experience the next/step malaise and using/switching to pry-byebug did not squelch it

Did anyone find a solution to this problem? I'm still seeing the problem even with the --debug flags

Edit: I needed to use two --debug flags, like this:
jruby --debug -S rspec --debug spec/controllers/users_controller_spec.rb

Sorry about bumping an old thread, still getting used to jruby

FYI:
jruby 1.7.12 (1.9.3p392), java 1.7.0_5, and
JRUBY_OPTS = "-Xcext.enabled=true --debug" works for me.
thanks!

OMG @JESii that totally worked, thank you so much for sharing! I thought we were never going to get a solution for this, so I just made my peace with it and moved on. Really nice to finally be able to do a proper next. It's the little things...

I cannot get JESii's solution to work.

My environment:
jruby 9.0.0.0 (2.2.2) 2015-07-21 e10ec96 Java HotSpot(TM) 64-Bit Server VM 25.74-b02 on 1.8.0_74-b02 +jit [Windows 7-amd64]

Rails 4.1.8

Is there a debugger out there that will actually work in the environment I have?