How to disable irb's welcome banner or how to enable it for the Rails console

Version 1.18.0 Show archive.org snapshot of irb introduced a welcome banner.
Here is how to disable it, or how to add it to your Rails console.

Welcome banner

Modern versions of irb show a pretty banner which prints

  • IRB version,
  • Ruby version,
  • a random IRB command hint,
  • current directory.

irb Screenshot

How to disable

If you prefer not to see this banner, update your ~/.irbrc (or create, if you don't have one yet) and add:

IRB.conf[:SHOW_BANNER] = false

How to enable for the Rails console

You like the banner and want to see it for a rails console as well? Simply add to your ~/.irbrc:

IRB::StartupMessage.display if defined?(Rails) && defined?(IRB::StartupMessage)
Arne Hartherz