IRB Console

May 4th, 2008

1
2
cd $PROJECT
ruby script/console development 

You need to learn the console. It allows you to examine and manipulate your code in a real-time environment. I recommend you read the following article, Secrets of the rails console ninja's, and follow its links.

The console configuration file

You can preload code into the console to make you time in it a little easier. The place to put or call this code is in a file called .irbrc. You need to create this file and place it in your $HOME directory.

Here is my .irbrc file, it just contains code I've copied from sites found through reading Secrets of the rails console ninja's. Some of the features it adds to my console are syntax highlighting (wirble), tab completion, accessing rails helpers from the console, and command history. Links to where I found these features can be found in my .irbrc file

Leave a Reply