While irb utilizes .irbrc to automatically perform certain actions upon start, I have not been able to find how to do the same automatically for invocations of ruby itself. Any suggestions where the documentation for such can be found would be greatly appreciated.
While irb utilizes .irbrc to automatically perform certain actions upon start, I have not
Share
For environments where I need this (essentially never) I’ve used the
-r [filename]option, and theRUBYOPTenvironment variable.(You may want to specify include directories, which can be done a variety of ways, including the
-I [directory]option).This is essentially the same answer as Phrogz, but without the shell script. The scripts are a bit more versatile since you can have any number of them for trivial pre-execution environment rigging.