Today I Learned

hashrocket A Hashrocket project

Enable commands history on rails console and irb

In order to enable commands history on rails console or irb you can just add the following to your ~/.irbrc file:

IRB.conf[:SAVE_HISTORY] = 200
IRB.conf[:HISTORY_FILE] = '~/.irb-history'

So if you close your rails console or irb the history is persisted. So next time just use the arrows UP/DOWN to get your history back.

reference

IRB Context documentation

See More #rails TILs
Looking for help? Hashrocket has been an industry leader in Ruby on Rails since 2008. Rails is a core skill for each developer at Hashrocket, and we'd love to take a look at your project. Contact us and find out how we can help you.