Using pry and pry-rails to debug rspec tests and after reinstalling my OS and losing my original configuration I've found that I'm not able to get pry history to load into a new session. I'm not sure if I've found a bug or missed something in the config.
History is being written to ~/.pry_history and I am able to load it into a new pry session with Pry.history.load, but unless I type this manually at the start of the session it's not loading. .pryrc has these:
Pry.config.history.file = "/Users/houdini/.pry_history"
Pry.config.history.should_save = true
Pry.config.history.should_load = true
Seems o be no different whether the rc is empty or the config is specified explicitly. The same config added to a project .pryrc has no effect
I had this same issue and fixed it (I think) by reinstalling ruby with readline:
RUBY_CONFIGURE_OPTS=--with-readline-dir=`brew --prefix readline` rbenv install 2.2.2
I have same issue and reinstalling ruby with readline didn't fix it
Oh sorry, now its working
Seems to new terminal session fix that
Same problem here. Reinstalling ruby with readline did not fix it for me. Using Ruby 2.2.3 and rbenv.
I made sure that .pryrc is being loaded. Here is my .pryrc file:
Pry.config.history.file = "/Users/ugur/.pry_history"
Pry.config.history.should_save = true
Pry.config.history.should_load = true
Pry.config.editor = 'vim'
Pry.history.load
puts "Finished loading Pry history"
Only if I enter Pry.history.load in pry manually this will work.
Fixed it following the instructions on:
https://github.com/guard/guard/wiki/Add-Readline-support-to-Ruby-on-Mac-OS-X
@tarlig, @quinn :+1:
It helped me too
Reinstalling Ruby with readline didn't help me. The only thing that helped me was adding rb-readline in the development group of my Gemfile.
Most helpful comment
Fixed it following the instructions on:
https://github.com/guard/guard/wiki/Add-Readline-support-to-Ruby-on-Mac-OS-X