wrong current line #584

rweng opened this Issue Mar 13, 2013 · 3 comments


None yet

5 participants

rweng commented Mar 13, 2013

I am sure this is a minor bug: It seems as if jruby get's the currently executed line wrong. Take this example file:

puts "hello"
require 'pry'

Now with the pry gem installed in both jruby and mri:

$ ruby --version
jruby 1.7.3 (1.9.3p385) 2013-02-21 dac429b on Java HotSpot(TM) 64-Bit Server VM 1.7.0_10-ea-b14 [darwin-x86_64]

$ ruby hello.rb

From: /Users/robin/hello.rb @ line 1 :

 => 1: puts "hello"
    2: require 'pry'
    3: binding.pry

[1] pry(main)> exit

$ rbenv use 1.9.3

$ ruby --version
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.2.1]

$ ruby hello.rb

From: /Users/robin/hello.rb @ line 3 :

    1: puts "hello"
    2: require 'pry'
 => 3: binding.pry

[1] pry(main)>

You see how in jruby pry thinks it's still in the first line, though it must be in the third line or the repl wouldn't have kicked in?


I'm unfamiliar with how pry works. Have you asked them what might be causing this? It would help us if we can reduce the problem a little further with their help.


This works by running jruby in debug mode (e.g. export JRUBY_OPTS=--debug) and is fixed in master altogether.

(see also: pry/pry#1008)

@mkristian mkristian added this to the JRuby 9000 milestone Jul 15, 2014
@enebo enebo modified the milestone: JRuby Jul 14, 2015
@enebo enebo added this to the JRuby 1.7.25 milestone Apr 1, 2016
enebo commented Apr 1, 2016

I just tried the example snippet on 1.7 and 9k branch and both show the proper line. Closing. Not sure when it was fixed and not worth the time to isolate when for posterity.

@enebo enebo closed this Apr 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment