Pry: Problem loading history

Created on 29 Apr 2015  路  7Comments  路  Source: pry/pry

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

Most helpful comment

All 7 comments

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.

@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.

Was this page helpful?
0 / 5 - 0 ratings