DEV Community ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป

DEV Community ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป is a community of 967,611 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Cover image for Do more with rails console by configuring ~/.irbrcย ๐ŸŽ‰
Rishi Pithadiya
Rishi Pithadiya

Posted on • Updated 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)

๐ŸŒš Life is too short to browse without dark mode