Persist Rails or IRB Console Command History After Exit

Updated . Posted . Visible to the public.

Create, or edit your ~/.irbrc file to include:

require 'irb/ext/eval_history' # was 'irb/ext/save-history' for versions prior to Ruby 3.3
IRB.conf[:SAVE_HISTORY] = 2000
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history"
Thomas Klemm
Last edit
Michael Leimstädtner
License
Source code in this card is licensed under the MIT License.
Posted by Thomas Klemm to makandra dev (2014-05-12 10:40)