Last Updated: February 25, 2016
·
1.555K
· pedrocarrico

Add history to the ruby irb console

To add a nice bash-like history to the irb console:

vi ~/.irbrc

And add this (tweak the SAVE_HISTORY to your heart's content):

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

Now rejoice while running irb and navigating through your previous ruby commands :-)

2 Responses
Add your response

Wow, that made my day. Great! :-D

over 1 year ago ·

+1

over 1 year ago ·