brew doctor warnings - delete or ignore? - homebrew

After I installed Homebrew,
Then I try the brew doctor command, there comes warnings:
Could I know the reasons and How to fix it? Could I just ignore these warnings?

The files reported by brew doctor are added by a software (that you manually installed before installing Homebrew) that uses a library for the Tcl/Tk language.
Homebrew also provides a library for Tcl/Tk and the existing files will conflict with those installed by Homebrew if you install a package that requires the Tcl/Tk library.
You don't have to worry for now and, very important, don't try to "fix" anything (especially don't remove files).
What you can do to "fix" it is to find out what program installed those files (it was not installed using the App Store, you installed it manually) and see if Homebrew provides it. If it is a macOS GUI application then Homebrew doesn't provide it (it contains only command line applications, no GUI) but Homebrew Cask might do it.
Use
$ brew search app
or
$ brew cask search app
If you are lucky and you find it and you are pleased with the version provided by Homebrew then you can uninstall the application using the uninstaller it hopefully provides then reinstall it using Homebrew (or Homebrew Cask).
You can run brew doctor between uninstall and reinstall to make sure the uninstaller removed all the files listed in the output of brew doctor now.

As written at the beginning of brew doctor's output, you can safely ignore these warnings if everything you use Homebrew for works fine.

Related

Error running '__rvm_make -j10' while installing ruby 2.6.5 on mac

I am trying to install the ruby 2.6.5 on mac having m1 pro chip but it's giving error of "__rvm_make -j10".
I tried to google but won't find error with "__rvm_make -j10". there is one question with the same error on stackoverflow and i tried the same method but it won't worked too.
i tried "rvm install 2.6.5 --with-out-ext=fiddle"
i tried with open ssl 1.0 too, but not any one worked.
sammalik#Sams-MacBook-Pro rubyporgram % rvm install 2.6.5
ruby-2.6.5 - #removing src/ruby-2.6.5 - please wait
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/13.0/arm64/ruby-2.6.5.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Updating certificates bundle '/opt/homebrew/etc/openssl#1.1/cert.pem'
Requirements installation successful.
Installing Ruby from source to: /Users/sammalik/.rvm/rubies/ruby-2.6.5, this may take a while depending on your cpu(s)...
ruby-2.6.5 - #downloading ruby-2.6.5, this may take a while depending on your connection...
ruby-2.6.5 - #extracting ruby-2.6.5 to /Users/sammalik/.rvm/src/ruby-2.6.5 - please wait
ruby-2.6.5 - #configuring - please wait
ruby-2.6.5 - #post-configuration - please wait
ruby-2.6.5 - #compiling - please wait
Error running '__rvm_make -j10',
please read /Users/sammalik/.rvm/log/1668327329_ruby-2.6.5/make.log
There has been an error while running make. Halting the installation.
UPDATE: Here's an updated blog post I wrote with the possible options if you really must use Ruby 2.6.x: https://www.rubyonmac.dev/how-to-install-ruby-2-6-on-macos-13-ventura
Instead, I highly recommend updating your project to at least 2.7.7. Here's a detailed guide I wrote that shows How and Why to Upgrade the Ruby Version in Your Project
Ruby 2.6.x is no longer supported on any Mac that has version 14 or higher of Apple's command line tools, which would be the case on macOS Ventura (13.0). Assuming you have Homebrew installed, you can check which version you have by running brew config, and then look towards the bottom for the lines that starts with CLT: and Xcode:
Ruby 2.6 reached end of life in March 2022, so it should not be used in production for security reasons. A lot of people get stuck because they think they have to use the version of Ruby that's specified in the project's .ruby-version and/or Gemfile. Instead, it's recommended to update the project to a newer version.
In most cases, it would be as easy as following these steps:
Install Ruby 2.7.7
Replace "2.6.x" with "2.7.7" in .ruby-version and Gemfile, and any other file where the Ruby version is specified (except Gemfile.lock because it should never be edited manually)
Run bundle install
Update any gems if necessary
Run your tests and make sure your app still works
Now that you know the recommended approach, let's go over 2 solutions in case you have a special need to use Ruby 2.6 before you update to 2.7.7:
Install Ruby with Homebrew
Downgrade to version 13.4 of the command line tools
Install Ruby with Homebrew
Install Homebrew if you haven't already
Install Ruby 2.6.10: brew install ruby#2.6
Follow the instructions for setting your PATH. For example, Homebrew will say something like this:
By default, binaries installed by gem will be placed into:
/opt/homebrew/lib/ruby/gems/2.6.0/bin
You may want to add this to your PATH.
If you need to have ruby first in your PATH, run:
echo 'export PATH="/opt/homebrew/opt/ruby/bin:$PATH"' >> ~/.zshrc
The reason this works is because this is a pre-built version of Ruby that was compiled with version 13.3 of the command line tools. However, note that it's not officially supported.
Note that you'll need to disable RVM or any other version manager you might have used before. And you'll only be able to use 2.6.10 with this setup. You won't be able to switch to other versions that you might have installed with RVM or another version manager.
This is meant as a temporary solution so that you can run your project with 2.6.10 and then update it to 2.7.7. Also, note that either way, you will need to update your project to at least 2.6.10. There's absolutely no reason to use 2.6.5. You should always make sure your apps are running the latest version in a series. For 2.6, it's 2.6.10, for 2.7, it's 2.7.7, then 3.0.5, and 3.1.3.
Downgrade to version 13.4 of the command line tools
This is not possible on macOS Ventura (13.0), so don't waste your time trying. If you're on macOS Monterey, you can download version 13.4 of the command line tools from Apple's developer site, and then install them. I also wrote step-by-step instructions for installing version 13.4 of the command line tools if you need them.
The following works fine with macOS Ventura 13.1. You have to choose an older openssl version e.g. openssl#1.0.2t
Make sure you have home-brew installed /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
(Optional) Check if you already have openssl versions installed via home-brew. Uninstall not ncessary versions brew uninstall openssl
Install openssl via home-brew: brew install openssl#1.0.2t
Check the path where your local home-brew packages go. In my case it is /usr/local/opt/openssl#1.0/.
Install ruby with rvm rvm install 3.1.3 --with-openssl-dir=/usr/local/opt/openssl#1.0/
I've been through a similar problem in Ubuntu 22.10. Here are some points that may help you:
Your OpenSSL may be too updated and probably has some breaking changes that don't allow some of your ruby C files to be compiled. Download a previous version at OpenSSL website, install it in a different location than your current version and use rvm install --with-openssl-dir=<old-openssl-dir> 2.6.5 as mentioned in Chris' answer.
Instead of using --with-openssl-dir option, you could add your old OpenSSL /bin and /include files directly in environment variables in your rvm command, like this: PATH=<old-openssl-bin-path>:$PATH C_INCLUDE_PATH=<old-openssl-include-path>:/usr/include rvm install 2.6.5. This could be useful in the case that --with-openssl-dir option isn't available for some reason. You also need to create links to the /lib files in your old OpenSSL folder. You'll probably find paired files like libssl.so and libssl.so.1.1. You can just move the version-named files into /usr/lib(or similar for macos), otherwise when you execute openssl command from your old OpenSSL folder, it will probably raise an error saying that openssl can't find libraries. If you choose to use this method, make sure that your rvm user bin files (at ~/.rvm/usr/bin) don't contain any files that may mess the ruby installing (like another openssl executable). You may get rid of this folder using rvm pkg remove.
Another possible solution is changing your gcc version. My OS came with gcc version 12.2.0, which comes with a change in computer gotos that failed my make step. To find errors in your ruby installation, check the make.log file specified at the rvm command error message and look for lines like this:

Xdebug install on macOS

I'm trying to install Xdebug on macOS Catalina but home-brew no longer allowed to run as root. Worked fine before Catalina update.
I was running Xdebug under Mojave but Catalina upgrade broke it. Removed extension to reinstall and then hit hombrew issue: get the following error when running brew as root:
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.
Brew should be working without using sudo.
If that's not the case, your homebrew install is broken and you might need to reinstall it.
In any case brew doctor is something you can always consult.
After you got your homebrew fixed,
looking into Can't install xdebug on Mac with Homebrew might be of help.
Updating homebrew should do the trick -
brew update

Warnings when running meld on Mac OS X Sierra

I've installed homebrew on my machine. Using brew I've installed meld. When I run it with git I get the following error:
Couldn't bind the translation domain. Some translations won't work.
'module' object has no attribute 'bindtextdomain'
2016-10-20 10:14:08.422 Python[22212:158273] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
(meld:22212): Gdk-WARNING **: GdkQuartzDisplay does not implement the monitor vfuncs
I don't understand how exactly brew works. In fact I never dug into its code, used it only to (un)install the software.
Did some online searches but there doesn't seem to be a solution to this. Has anyone figured it out?
Homebrew is simply a a package manager for MacOS. Unlike Linux, Mac doesn't always have all the external libraries you may need for things like wget, pip, etc out of the box. Homebrew tries to bridge this gap.
As for troubleshooting your issue, following Homebrew's troubleshooting steps helped me... You are probably just stuck in dependency hell, since Homebrew integrates alot of its libraries with Xcode (for me it was needing to update Xcode to latest): https://github.com/Homebrew/brew/blob/master/docs/Troubleshooting.md#troubleshooting
It's really important to keep thing up-to-date with brew update and then running brew doctor and brew prune resolved alot of issues for me as well.
If all else fails, homebrew seemed to have moved the meld formulae from homebrew/core to caskroom/cask. So I recall having to run the following command after running brew doctor and updating Xcode:
$ brew uninstall meld
$ brew install meld
Error: No available formula with the name "meld"
It was migrated from homebrew/core to caskroom/cask.
You can access it again by running:
brew tap caskroom/cask
$ brew tap caskroom/cask
$ brew cask install meld
==> Downloading https://github.com/yousseb/meld/releases/download/osx-9/meldmerge.dmg
######################################################################## 100.0%
==> Verifying checksum for Cask meld
==> Moving App 'Meld.app' to '/Applications/Meld.app'.
==> Linking Binary 'Meld' to '/usr/local/bin/meld'.
🍺 meld was successfully installed!

See what options I used when I installed a brew package

How can I check which options I installed a brew package with? For example, I have homebrew gcc installed. Is there someway to check if it was installed with the --multi-lib option?
brew info will display the options used. Also, each install contains a file INSTALL_RECEIPT.json in its Cellar directory for keeping track of used and unused options.

multiple side-by-side versions with Homebrew?

Is it possible to install multiple versions side-by-side with Homebrew?
I find myself in a situation needing sbt-0.7.x, sbt-0.10.x and sbt-0.11.0. I've installed both sbt-0.7.7 and sbt-0.10.1 manually at the moment to work around the issue (with sbt-0.11.0 being the latest 'sbt' from Homebrew).
Yeah. When you install a new version of a package, it keeps the old one. The symlinks in /usr/local/bin or wherever point to the latest version, but you can still call the binaries (or link to the libraries) in the older version.
brew list to see what's installed. You can look in package directories to see all the versions; or call brew list --versions to see all packages and all versions.
To easily switch between versions of formulae, you can use:
brew switch <formula> <version>
For example:
brew switch gradle 3.2.1
To list which versions you have installed try:
brew list --versions
or:
brew list <formula> --versions
If you want to get rid of older versions, just use:
brew cleanup
As of Homebrew 2.0.0, it would remove old packages automatically when brew upgrade is called. (https://brew.sh/2019/02/02/homebrew-2.0.0/). To opt-out of this behavior, set the environment variable: export HOMEBREW_NO_INSTALL_CLEANUP=1

Resources