DEV Community

Cover image for Do more with rails console by configuring ~/.irbrc 🎉
Rishi Pithadiya
Rishi Pithadiya

Posted on • Edited on

Do more with rails console by configuring ~/.irbrc 🎉

It´s better to wait for a productive programmer to become available than it is to wait for the first available programmer to become productive. 
Steve McConnell

What is ~/.irbrc file? 🔖

  • After work with multiple Rails apps, you might have some methods and preferred ways of working with them. 
  • i.e. you're using few generalized methods or configuration your IRB session(rails console) in a single project and want to have the same methods & configuration on other projects you're working on, you can add those methods & configuration in your ~/.irbrc file.
  • You can create ~/.irbrc file in your root directory if it's not present.

Things you can include in your ~/.irbrc file 🗄

  • Configurations which need to be used in all Rails Apps
  • Methods which need to be used in all Rails Apps
  • Require/load specific file(s) or Gem(s)
  • Hacky convenience methods that help you play with your objects

My .irbrc file 🧮

How to search awesome .irbrc file created by other devs 📭

Just click on the following URL and it'll list all ~/.irbrc files created by other GitHub developers, you can create your file and add everything you need if you find anything useful -

References 📌


Found this post useful? please click the 🖤 button and share it to help others find it! Feel free to leave a comment below.


👋 Say Hello! Twitter | LinkedIn | Medium | Instagram |

Top comments (0)