When investigating an irb problem on my Mac (OS X 10.11.5), I noticed /etc/irbrc . The first few lines follow:
# Some default enhancements/settings for IRB, based on # http:
It seems that this is deprecated (rubygarden.org is gone, rubigems are now in the standard library) and does what I always thought I should have done in my own ~/.irbrc (configure completion, history, etc.).
It is dated January 31, 2016. Perhaps I could or could not start updating the Apple system or update something else on that date; I do not remember. Since then, I have definitely upgraded OS X with a major version or two.
I do not think that I have Rubies on this computer, other than this, from OS X and Ruby 2.3.1 installed using rbenv (in my account, not root). That is, I do not think this file could have come from anything other than OS X.
The Unix shell convention would have led me to have a file named /etc/irbrc execute when any user runs irb before their ~/.irbrc , if any. However, the irb installed by OS X does not seem to read this file: I put puts 1 at the top and cannot see the result when irb starts. (I usually use rbenv, but disabled it when examining this file.) /etc/irbrc does not work, regardless of whether I have ~/.irbrc . In addition, I do not see references to this file in /usr/bin/irb or /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/irb .
I assume this file
- OS X is installed
- irb as cannot be read (despite its misleading name and location), but is intended to be copied to
~/.irbrc .
Does anyone know for sure or know something else?
I do not need or do not need it; I am happy to keep my own ~/.irbrc . I just want to make sure that this does not affect irb when I run it (in particular, irb in the Rbenv-installed Ruby, which I usually use), and that future OS X updates will not change the behavior of irb.
ruby irb macos
Dave Schweisguth Jun 03 '16 at 14:51 2016-06-03 14:51
source share