In both the IRB from Ruby 1.6.4 and irb-0.9-02.07.03.tgz from RAA,
there appears to be a bug in the handling of $irbrc: it’s ignored.
I think the problem is in init.rb, here:
rcs = 
rcs.push File.expand_path("~/.irbrc") if ENV.key?(“HOME”)
rcs.push “$irbrc” ### Here
# now try each file.
Note the quotes around “$irbrc”. I suggest the last line read like this:
rcs.push $irbrc if $irbrc
That works when I try it.
I’m tempted to suggest that $irbrc come first in the list of init
files to try, rather than last. I’m tweaking IRB to be a command-line
interface to an application. I have to delete HOME from ENV to avoid
having ~/.irbrc loaded instead of the application-specific init file
Since I may be the first person ever to use $irbrc, it seems unlikely
the change would break someone else’s code. However, it would make a
lie of the sentence in Programming Ruby that describes the load
If I told you this mail message would have an attachment, it doesn’t
seem to, and you use Outlook to read mail: you’ve probably been
bitten by an Outlook bug. The attachment is really there, Outlook
just isn’t showing it to you. You can still save it with File | Save
Attachments. (If that doesn’t work, I must have forgotten to attach
the file.) I’m sad when my choice of a Macintosh and the Eudora
mailer is an inconvenience to others.
“Act always so as to increase the number of choices.” – Heinz von Foerster
Brian Marick, firstname.lastname@example.org
www.testing.com - Software testing services and resources
www.testingcraft.com - Where software testers exchange techniques
www.visibleworkings.com - Adequate understanding of system internals