Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rbenv irb history is not saving

I install ruby via rbenv-installer.

When I use irb console, I can use history by pressing up and down on keyboard. And when I exited from console and start it again, I can't use prewious history. When I press up-arrow-button, nothing was happened.

When I used rvm this option was working. How can I switch on it in rbenv?

like image 325
arturtr Avatar asked Jun 21 '12 11:06

arturtr


2 Answers

I found this way for solving my problem. In file ~/.irbrc write:

require 'irb/ext/save-history'
#History configuration
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"

Found in this question: irb history not working

like image 81
arturtr Avatar answered Sep 21 '22 18:09

arturtr


Create ~/.irbrc if it does not exist, and add the following line to it:

IRB.conf[:SAVE_HISTORY] = 1000
like image 41
Weston Ganger Avatar answered Sep 22 '22 18:09

Weston Ganger