Put the following in the .irbrc file (%USERPROFILE%/.irbrc for Windows), and you get code completion and saved history of commands:
require 'irb/completion'
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]
# requires Ruby 1.8.4
require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:EVAL_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['USERPROFILE']}/.irb-save-history"
UPDATE: After some time, this stopped working on one of my Windows machines. FileMon showed my .irbrc file was never getting loaded, irb was only looking for it in the current directory. In trying to research why my Ruby 1.8.4 install irb wasn't looking for this file in my %USERPROFILE% folder, I didn't find a fix, but I did find a good workaround that worked for me:
An alternate approach is to create an environment variable called IRBRC and set it to the full path of the .irbrc file.
tags: ComputersAndTechnology