Clear your messed up rails console

Reading time ~1 minute

Clearly everybody using rails will have this problem. When your model gets bigger and bigger, you will find it difficult to spot your attributes in the rails console. So let’s clear this messed up console and format it a little bit. We have a gem called ‘awesome_print’. Install it using

gem install awesome_print

Then open your ~/.irbrc file and add these lines to it.

# load libraries
require 'rubygems'
$LOAD_PATH<< '/path/to/awesome_print-x.x.x/lib'
require 'awesome_print'

usually if you use RVM and ruby 1.9.3 your path to awesome_print gem will be like


now fire up your rails console and try to print any object prepended with ‘ap’

ap User.first

Hooray!!! We formatted the console. But wait, we missed something. Printing everything with ‘ap’ prepended seems inappropriate. So let’s make awesome_print our default formatter. Now, open your ~/.irbrc again and add this line after requiring awesome_print.


Now you will be able to format everything you print beautifully. And you can add options to awesome print. See the documentation for more details.

Enjoy hacking !!!

Iterators and Generators in Javascript

Iterators are one of the least used features in Javascript. But, when used correctly, it gives very powerful abilities.### What is the It...… Continue reading

Introducing ember-cli-lunr

Published on June 16, 2016

How to change the hash_secret of Paperclip

Published on November 09, 2015