3

I need to change some configuration for the brew doctor tool and by surfing the web I learned that this can be done by editing the doctor.rb file and adding some custom code inside it.

The problem is that when I run

locate doctor.rb

I get an output like this:

/Applications/Xcode.app/Contents/Developer/[...]/ruby/2.3.0/rubygems/doctor.rb
/Library/Developer/CommandLineTools/SDKs/[...]/ruby/2.3.0/rubygems/doctor.rb
/System/Library/Frameworks/[...]/2.0/usr/lib/ruby/2.0.0/rubygems/doctor.rb
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/doctor.rb
/usr/local/Homebrew/Library/Homebrew/cmd/doctor.rb
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/[...]/doctor.rb

So, which doctor.rb file should I edit to customize the configuration?

2
  • Can you share the link for the article that outlines the instruction to edit doctor.rb?
    – Nimesh Neema
    Commented Mar 29, 2018 at 10:48
  • @NimeshNeema this question has a very good answer, the one by Brian Carlson, where he suggests to edit file doctor.rb to add a "white list" to avoid warnings about some "unbrewed" dynamic libraries. He suggests to find the file using locate doctor.rb but as you say in my question this my provide multiple answers. Commented Mar 30, 2018 at 19:19

1 Answer 1

2

Update to incorporate Apple Silicon Mac:

The file that you are looking to edit should be present in Homebrew installation directory, which generally is /usr/local, on Intel Macs and /opt/homebrew on Apple Silicon Macs.

From your shared locate output, the one matching the criterion is:

  • /usr/local/Homebrew/Library/Homebrew/cmd/doctor.rb on Intel Macs.

  • /opt/homebrew/Library/Homebrew/cmd/doctor.rb on Apple Silicon Macs.

4
  • Many thanks @NimeshNeema but, based on what you say, the last three lines in my answer would all be suitable to be the right one, what do you think? Commented Mar 30, 2018 at 19:21
  • 1
    /usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/doctor.rb corresponds to Homebrew cask. The last one, i.e. /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/[...]/doctor.rb is not a part of Homebrew proper. So my answer still stands the same.
    – Nimesh Neema
    Commented Mar 30, 2018 at 19:24
  • Many thanks for the precious information about Homebrew cask, I thought cask was just a command-line argument for the command-line brew tool. Commented Mar 31, 2018 at 18:02
  • 2
    Note that on Apple Silicon, Homebrew installs to a different location. The path is currently /opt/homebrew/Library/Homebrew/cmd/doctor.rb for M1/M2 macs. Commented Oct 12, 2023 at 22:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .