I'm following along with a tutorial book, and in order to step through my code I've required pry and added a binding.pry reference in a method which gets executed:
require 'pry'
module Rulers
module Model
class FileModel
def initialize(filename)
@filename = filename
binding.pry
basename = File.split(filename)[-1]
...
When I load the code which executes this constructor method, I successfully hit my binding.pry debugger point as expected. However, when I start typing commands at the prompt, the characters I enter are printed out in the same prompt:
[7] pry(#<Rulers::Model::FileModel>)> .whic.whichh
In the above example, I typed .which. I had gotten all the way to .whic when the REPL added the characters I had typed thus far (i.e. it added .whic to .whic, resulting in .whic.whic). The last character I typed was h, which registers after .whic.whic. Finally, the last h I typed was also appended to the chars on the prompt.
Interestingly, the duplicated chars do not appear to affect the REPL's ability to understand the commands I type in. For example, the following:
[8] pry(#<Rulers::Model::FileModel>)> .which .which vim
[8] pry(#<Rulers::Model::FileModel>)> .which vim
/usr/bin/vim
In the above example, I was successful in typing .which quickly enough to not result in a muddled version of the which command, and I also pressed Enter before vim could be duplicated erroneously. If the redundant 2nd .which command were to affect my ability to return the expected output, I would expect to see an error returned. Instead, I see /usr/bin/vim as I would expect when typing which vim in my regular, non-pry command line prompt.
I have no theories on where to begin debugging this. Any ideas?
byebugdebugger and see if it has the same issue.:developmentenvironment, using the "Rebuilding Rails" tutorial. The app runs a simple WEBrick server, executed usingbundle exec rerun -- rackup -p 3001.rerun, just to make sure you can eliminate as many parts as possible which could be causing the issue.rerunreference seems to have done the trick! I removed it and restarted the server with a simplebundle exec rackup -p 3001and things seemed to work fine even over a significant length of time. Then I killed the server and restarted it withrerunprepended again, and the problem re-appeared.