Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news.

Wirble: Tab-Completion and Syntax Coloring for irb

By Peter Cooper / December 17, 2006

If you haven't got tab-completion and syntax coloring in your irb, you owe it to yourself to follow these instructions right away (should work for Linux, OS X, and Cygwin users). First, install the Wirble gem:

sudo gem install -y wirble

Next, create or edit a file called .irbrc in your home folder (~/.irbrc), and make sure these lines are included there:

require 'rubygems'
require 'wirble'

Now play with irb and see joy similar to that in the screenshot above. Try tab-completion too. It's great!


  1. matt says:


  2. ariekeren says:

    nice. however it doesn't colorize pp

  3. John Athayde says:

    Nice tip! I'm rolling with it on my system now. A bit difficult to read some of the darker colors on an inverted shell (white on black), especially when you add transparency to it, but I'll manage to deal :)

  4. Matt Baron says:

    Anyone know if its possible to control the way it colors the syntax?

  5. Matt Baron says:

    Upon further investigation, I found you can change the way Wirble colorizes. Its right in there doc:

  6. Jan Wedekind says:

    Very nice!
    I added a default rule and colour for unidentified characters because at the moment the brackets '(' ')' are not displayed by wirble.

    > :comma => :blue,
    > :refers => :blue,
    > :object_addr_prefix => :blue,
    > :object_line_prefix => :blue,

  7. Jan Wedekind says:

    The diff in my posting got screwed up. I put my modified version based on wirble-0.1.2 here:

  8. Sergio Espeja says:

    This is great! helps a lot the work with irb!

  9. Michael Lee says:

    You can also add 'irb/completion'

    My .ircrb looks like

    require 'irb/completion'
    require 'rubygems'
    require 'wirble'

    ARGV.concat [ "--readline", "--prompt-mode", "simple" ]

Other Posts to Enjoy

Twitter Mentions