rbenv irb history is not saving

前端 未结 2 986
滥情空心
滥情空心 2020-12-14 18:57

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

相关标签:
2条回答
  • 2020-12-14 19:33

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

    IRB.conf[:SAVE_HISTORY] = 1000
    
    0 讨论(0)
  • 2020-12-14 19:46

    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

    0 讨论(0)
提交回复
热议问题