If you are still looking for an answer, this is what I am doing. I created a ~/.irbrc file in which you put all the code you want to load into your rails console.
This is the contents of my file:
require "awesome_print" include Rails.application.routes.url_helpers AwesomePrint.irb! def y(obj) puts obj.to_yaml end
source share