Fixing homebrew on Mac OSX 10.13.2 - macos

Just wondering if anyone can help fix homebrew for me. It was working a minute ago...
I am trying to install new packages using Homebrew on my 2 Macbooks. Both are running High Sierra, which I suspect might be the problem due to Apple borking root permissions...
Anyway, my issue goes a little something like this:
❯❯❯ brew install git
Error: git 2.14.2 is already installed
To upgrade to 2.15.1, run `brew upgrade git`
Okay. Lets upgrade Git.
❯❯❯ brew upgrade git
==> Upgrading 1 outdated package, with result:
git 2.15.1
==> Upgrading git
==> Downloading https://homebrew.bintray.com/bottles/git-2.15.1.high_sierra.bottle.tar.gz
Error: curl is not executable
Warning: Bottle installation failed: building from source.
==> Downloading https://www.kernel.org/pub/software/scm/git/git-2.15.1.tar.xz
Error: curl is not executable
Strange. I use curl daily...
❯❯❯ curl
curl: try 'curl --help' or 'curl --manual' for more information
❯❯❯ which curl
/usr/bin/curl
❯❯❯ ls -al /usr/bin/curl
-rwxr-xr-x 1 root wheel 185104 Dec 1 15:45 /usr/bin/curl
So it exists and looks executable. Maybe the homebrew links got messed up? I will re-install curl using brew
❯❯❯ brew install curl
==> Downloading https://homebrew.bintray.com/bottles/curl-7.57.0.high_sierra.bottle.tar.gz
Error: curl is not executable
Warning: Bottle installation failed: building from source.
==> Downloading https://curl.haxx.se/download/curl-7.57.0.tar.bz2
Error: curl is not executable
So basically homebrew is not working for me. On TWO different machines running the same Mac OS version 10.13.2
NOTE: This is not limited in any way to installing git. The problem started trying to install minikube.
UPDATE
I checked my setup via brew config and noticed that although I DO have curl installed, homebrew does not see it: Curl: N/A
HOMEBREW_VERSION: 1.4.1
ORIGIN: https://github.com/Homebrew/brew
HEAD: b4d43e950fd45c24e48d6ebfd3013357abcd21a9
Last commit: 10 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 809322678d0fb7ab034348f86f0e452eff203b49
Core tap last commit: 73 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_VISUAL: nano
CPU: octa-core 64-bit haswell
Homebrew Ruby: 2.3.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/bin/ruby
Clang: 9.0 build 900
Git: 2.14.3 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: N/A
Perl: /usr/bin/perl
Python: /usr/local/opt/python/libexec/bin/python => /usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Java: 1.8.0_31
macOS: 10.13.2-x86_64
Xcode: 9.2
CLT: 9.2.0.0.1.1510905681
X11: 2.7.9 => /opt/X11
The OS already has curl installed, but homebrew does not see it.
I cannot install curl using homebrew (see above).
So now the problem becomes "How do I fix homebrew so it sees curl"?

I was running into the same issue yesterday. For me it was caused by a file called curl left over from a botched command in the same directory where I was running brew. Deleting that file resolved the issue.

I had same problem and I have no idea how but I fixed it. First I uninstalled any brew-version of curl that was installed. Then, when that didn't work, I navigated to \bin\usr\curl to make sure it was still there. I then ran curl in terminal (just literally `curl' and then which curl to make sure it was using right one), and then reran brew and it seemed to work. I think what happens is that for some reason in new Mac files sometimes don't appear locally until you open them for the first time when using iCloud. Its happened before with other dependencies, where I had to navigate to file and physically open it before it would be locally downloaded and be recognized as a dependency. Not sure if Mac does same thing with curl. If so, quite dumb.

I had this same issue, also on Mac OS High Sierra. I ended up running brew uninstall curl. This gave me an error, but then when I installed Homebrew curl again, it worked and I could install git and others.

if you have tried everything and nothing helps, if you're facing permissions issues - try to re-install the Homebrew:
uninstall:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
and then install it again:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
helped in my case

Related

Error when installing graphviz on Mac using Homebrew

I am using macOS 11.5.1 Big Sur and I tried to install Graphviz via
brew install graphviz
but I got an error:
Error: python#3.9: wrong number of arguments (given 1, expected 0)
The version of my Homebrew is
Homebrew 3.0.5
Homebrew/homebrew-core (git revision 7ff3c752de; last commit 2021-08-13)
Homebrew/homebrew-cask (git revision af069ca1b1; last commit 2021-08-13)
I have no idea about the reason. Any suggestions? Thank you.
I have fixed this issue, by the following commands.
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --switch /Applications/Xcode.app
Then rerun the brew install:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
It works on my Mac. Just share in case that anyone encounters the same issue.
I was unable to get it to work with homebrew. I read other threads recommending trying with Ports, which I did and failed also, since I got a little farther with Ports, I continue to look and finally found this...
Uninstall graphiz if you tried homebrew: brew uninstall graphviz
Install Ports https://www.macports.org/install.php
edit the Ports installation https://www.macports.org/install.php
Edit opt/etc/macports/sources.conf, comment out the rsync entry, and add a new entry as follows:
#rsync://rsync.macports.org/macports/release/tarballs/ports.tar [default]
https://distfiles.macports.org/ports.tar.gz [default]
Run sync in debug mode and watch for the tarball being used instead of rsync:
sudo port -d sync
sudo port install graphviz

Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)

I use the latest Apple M1 chip processor. And I keep getting errors while application installation.
say.,
brew install openjdk#11
Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)!
Please create a new installation in /opt/homebrew using one of the
"Alternative Installs" from:
https://docs.brew.sh/Installation
You can migrate your previously installed formula list with:
brew bundle dump
Need help with exact steps to follow.
For what it's worth, before installing Homebrew you will need to install Rosetta2 emulator for the new ARM silicon (M1 chip). I just installed Rosetta2 via terminal using:
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
This will install rosetta2 with no extra button clicks.
After installing Rosetta2 above you can then use the Homebrew cmd and install Homebrew for ARM M1 chip: arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Once Homebrew for M1 ARM is installed use this Homebrew command to install packages: arch -x86_64 brew install <package>
Homebrew needs to be installed in two places on Apple silicon: in /usr/local for rosetta-emulated (Intel) code, and /opt/homebrew for ARM64. These are somewhat hard-coded and the /opt/homebrew one MUST be used for ARM code, as it stands today, and is non-negotiable. However, it's easy enough to install and you can follow the general instructions on the official docs. You open a Rosetta shell first.
% arch -x86_64 zsh
% cd /usr/local && mkdir homebrew
% curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
Later, to install tools under intel you can use the arch command per-command or open a zsh terminal as above.
arch -x86_64 /usr/local/homebrew/bin/brew install sometool
For the ARM architecture, you don't need to use arch but you do need to use the full path of the homebrew command.
/opt/homebrew/bin/brew install sometool
You could rename the brew commands to something like brew86 and brewARM to help keep them separate.
Run this in the terminal it fixes the issue
eval "$(/opt/homebrew/bin/brew shellenv)"
Just use:
arch -arm64 brew install package-name
replace 'package-name' with the package you want to install.
Did a temporary fix by enabling Open using Rosetta option in the terminal app from Utilities folder.
However, it would be great to know the actual solution for this question to use the native way.
There is a lot of helpful info in the replies here, but there doesn't seem to be a direct answer to the original request, "Need help with exact steps to follow."
In case it may help people facing this issue in the future, I'll share the exact steps that I followed to resolve the issue.
The following CLI commands are intended to be run on an Apple silicon-equipped Mac in the built-in Terminal application running the macOS-default shell, Zsh:
Run a Homebrew command to confirm that an error like the following appears:
$ brew install <formula>
Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)!
Please create a new installation in /opt/homebrew using one of the
"Alternative Installs" from:
https://docs.brew.sh/Installation
Or:
$ brew doctor
Warning: Your Homebrew's prefix is not /opt/homebrew.
Some of Homebrew's bottles (binary packages) can only be used with the default
prefix (/opt/homebrew).
You will encounter build failures with some formulae.
If either of these errors appears, it is likely that the steps below are applicable to your case.
Navigate to the /opt folder:
$ cd /opt
Create a folder named homebrew. By default superuser privileges are required to write inside of the /opt folder, which means that it is necessary to use sudo:
$ sudo mkdir homebrew
Grant write access to the homebrew folder so that your user can perform the Homebrew installation:
$ sudo chmod go+w homebrew
Perform the four steps listed on the "Alternative Installs" page (the page mentioned in the first error message in step 1):
Install Homebrew:
$ curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
Set Homebrew's prefix in your current Terminal session:
$ eval "$(homebrew/bin/brew shellenv)"
Update Homebrew:
$ brew update --force --quiet
Revoke write access to specific folders and files:
$ chmod -R go-w "$(brew --prefix)/share/zsh"
Set Homebrew's prefix in future Terminal sessions by adding the necessary command to one of Zsh's startup files. As far as I can tell, .zshrc is the preferred startup file for this type of command:
$ echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zshrc
Note that if there are any other existing Terminal sessions on your machine that have been open since before running the above command, the correct Homebrew prefix will still be unset in those sessions.
Confirm that Homebrew's prefix is now properly set:
$ type -a brew
brew is /opt/homebrew/bin/brew
brew is /usr/local/bin/brew
Or:
$ brew doctor
Your system is ready to brew.
It should now be possible to continue using Homebrew normally.
This issue with new macbook pro M1 chip
Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)!
For Resolve follow below steps
Step1
$ brew bundle dump
Step2
$ /bin/bash -c "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Step3
Edit file below
$ vi ~/.bashrc or vi ~/.zshrc
Edit below line in above file
export PATH=/opt/homebrew/bin:$PATH
Homebrew is now available for the new apple M1 chip at https://docs.brew.sh/Installation. The script installs in a new location, ‘/opt/homebrew’ instead of ‘/usr/local’ which requires that you implement a couple lines of script after the install, substituting your username. You can copy/paste from the comments in your install. Just don’t skip these steps.
==> Next steps:
- Add Homebrew to your PATH in /Users/[username]/.zprofile:
echo 'eval "$(/opt/homebrew/bin/brew [username])"' >> /Users/[username]/.zprofile
eval "$(/opt/homebrew/bin/brew [username])"
Note: This works for a clean install of Homebrew on a new machine. If you have already installed an old version of Homebrew and got it working, I believe you need to uninstall that first -or- you may find this a quicker work-around http://blog.wafrat.com/homebrew-on-mac-with-m1/. Not tested.
See: https://docs.brew.sh/Installation
1. Clone homebrew
$ cd /opt
$ sudo git clone https://github.com/Homebrew/brew homebrew
2. Chown dir
$ sudo chown -R $(whoami):staff /opt/homebrew
3. Update new brew shellenv temporarily, more shellenv meaning see man brew
$ eval "$(homebrew/bin/brew shellenv)"
4. New brew update
$ brew update --force --quiet
==> Homebrew has enabled anonymous aggregate formula and cask analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics
No analytics have been recorded yet (nor will be during this `brew` run).
==> Tapping homebrew/core
Cloning into '/opt/homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Enumerating objects: 1265097, done.
remote: Counting objects: 100% (207/207), done.
remote: Compressing objects: 100% (97/97), done.
remote: Total 1265097 (delta 120), reused 192 (delta 110), pack-reused 1264890
Receiving objects: 100% (1265097/1265097), 517.64 MiB | 3.02 MiB/s, done.
Resolving deltas: 100% (872476/872476), done.
Tapped 3 commands and 6273 formulae (6,616 files, 566.4MB).
5. Make sure remove other person write privage
$ chmod -R go-w "$(brew --prefix)/share/zsh"
6. Confirm new brew version
$ brew --version
Homebrew 3.6.0
Homebrew/homebrew-core (git revision 57f5c02ec6a; last commit 2022-09-10)
7. Brew config show
/opt/homebrew on  stable (93ea8cb2c) 💰 17:17:54
$ brew config
HOMEBREW_VERSION: 3.6.0
ORIGIN: https://github.com/Homebrew/brew
HEAD: 93ea8cb2c40e1ef25f1489b0267526bd47bc8030
Last commit: 3 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 57f5c02ec6af877482ecd8753066d6a277cd3213
Core tap last commit: 72 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_REPOSITORY: /opt/homebrew
HOMEBREW_CELLAR: /opt/homebrew/Cellar
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 10
Homebrew Ruby: 2.6.8 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: 10-core 64-bit westmere
Clang: 13.1.6 build 1316
Git: 2.32.1 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.79.1 => /usr/bin/curl
macOS: 12.5.1-x86_64
CLT: 13.4.0.0.1.1651278267
Xcode: 13.4.1
Rosetta 2: true
8. Add new brew shellenv to strart bash shell, eg. ~/.zshrc、~/.barshrc etc.
eval "$(/opt/homebrew/bin/brew shellenv)"
This also may occur if you are trying to run your command in IntelliJ Terminal. Just try to run in (Regular) Terminal.
First run this command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
then it will ask you a question, hit return, then wait for the installation to be completed. After than run this command:
brew bundle dump
Go over to https://brew.sh and use the command. It will download and install brew again correctly.
Run this command as this will resolve the issue
arch -arm64 brew install kotlin
I had installed Homebrew using iTerm enabled for the Apple ARM chip (M1), but when using a different terminal program that was Intel-based (and thus opening in Rosetta) I got this error. The latter app is seen as Intel, and thus wants to use the older Homebrew path.
Probably this error is related running brew on M1/M2 Mac instead instead of Intel based Mac, atleast that was in my case. I had previously restored a Time Machine backup from Intel to M2.
According to the Homebrew documentation, the default installation script installs Homebrew to its preferred /usr/localfor macOS Intel and /opt/homebrew for Apple Silicon.
You can well use this, as it worked well for me-
re-install brew by running this in your terminal /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
run brew bundle dump
You should be good on using brew
So I bought a new M1 and migrated to it. I took it back and migrated back. I was receiving this error. Found that I needed to run sudo rm -Rf /opt/homebrew after re-installing brew to get things flowing again. 16G Ram on the M1 didn't replace my workflow with Intel using 64G.

Homebrew refusing to link OpenSSL on OS X 10.12 [duplicate]

I'm on: OSX 10.11.6, Homebrew version 0.9.9m OpenSSL 0.9.8zg 14 July 2015
I'm trying to play with with dotnetcore and by following their instructions,
I've upgraded/installed the latest version of openssl:
> brew install openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2h_1.el_capitan.bottle.tar.gz
Already downloaded: /Users/administrator/Library/Caches/Homebrew/openssl-1.0.2h_1.el_capitan.bottle.tar.gz
==> Pouring openssl-1.0.2h_1.el_capitan.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
This formula is keg-only, which means it was not symlinked into /usr/local.
Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
But when I try to link openssl I continue to run into this linking error:
> brew link --force openssl
Warning: Refusing to link: openssl
Linking keg-only OpenSSL means you may end up linking against the insecure,
deprecated system version while using the headers from the Homebrew version.
Instead, pass the full include/library paths to your compiler e.g.:
-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib
The option to include compiler flags doesn't make sense to me, since I'm not compiling these libraries that I'm dependent on.
EDIT dotnetcore has updated their instructions:
brew update
brew install openssl
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
This is what worked for me:
brew update
brew install openssl
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/Cellar/openssl/1.0.2j/bin/openssl /usr/local/bin/openssl
Thanks to #dorlandode on this thread https://github.com/Homebrew/brew/pull/597
NB: I only used this as a temporary fix until I could spend time correctly installing Openssl again from scratch. As I remember I spent best part of a day debugging and having issues before I realised the best way was to manually install the certs I needed one by one. Please read the link in #bouke's comment before attempting this.
As the update to the other answer suggests, the workaround of installing the old openssl101 brew will no longer work. For a right-now workaround, see this comment on dotnet/cli#3964.
The most relevant part of the issue copied here:
I looked into the other option that was suggested for setting the rpath on the library. I think the following is a better solution that will only effect this specific library.
sudo install_name_tool -add_rpath /usr/local/opt/openssl/lib /usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.0/System.Security.Cryptography.Native.dylib
and/or if you have NETCore 1.0.1 installed perform the same command for 1.0.1 as well:
sudo install_name_tool -add_rpath /usr/local/opt/openssl/lib /usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.1/System.Security.Cryptography.Native.dylib
In effect, rather than telling the operating system to always use the homebrew version of SSL and potentially causing something to break, we're telling dotnet how to find the correct library.
Also importantly, it looks like Microsoft are aware of the issue and and have both a) a somewhat immediate plan to mitigate as well as b) a long-term solution (probaby bundling OpenSSL with dotnet).
Another thing to note: /usr/local/opt/openssl/lib is where the brew is linked by default:
13:22 $ ls -l /usr/local/opt/openssl
lrwxr-xr-x 1 ben admin 26 May 15 14:22 /usr/local/opt/openssl -> ../Cellar/openssl/1.0.2h_1
If for whatever reason you install the brew and link it in a different location, then that path is the one you should use as an rpath.
Once you've update the rpath of the System.Security.Cryptography.Native.dylib libray, you'll need to restart your interactive session (i.e., close your console and start another one).
None of these solutions worked for me on OS X El Capitan 10.11.6. Probably because OS X has a native version of openssl that it believes is superior, and as such, does not like tampering.
So, I took the high road and started fresh...
Manually install and symlink
cd /usr/local/src
If you're getting "No such file or directory", make it:
cd /usr/local && mkdir src && cd src
Download openssl:
curl --remote-name https://www.openssl.org/source/openssl-1.0.2h.tar.gz
Extract and cd in:
tar -xzvf openssl-1.0.2h.tar.gz
cd openssl-1.0.2h
Compile and install:
./configure darwin64-x86_64-cc --prefix=/usr/local/openssl-1.0.2h shared
make depend
make
make install
Now symlink OS X's openssl to your new and updated openssl:
ln -s /usr/local/openssl-1.0.2h/bin/openssl /usr/local/bin/openssl
Close terminal, open a new session, and verify OS X is using your new openssl:
openssl version -a
Just execute brew info openssland read the information where it says:
If you need to have this software first in your PATH run: echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
If migrating your mac breaks homebrew:
I migrated my mac, and it unlinked all my homebrew installs - including OpenSSL. This broke gem install, which is how I first noticed the problem and started trying to repair this.
After a million solutions (when migrating to OSX Sierra - 10.12.5), the solution ended up being comically simple:
brew reinstall ruby
brew reinstall openssl
Edit much later: as Gal Bracha noted in the comments, you ?might? need to delete /usr/local/opt/openssl before doing the reinstalls, just to be safe. I didn't need to at the time, but if you're still having trouble, give that a try.
After trying everything I could find and nothing worked, I just tried this:
touch ~/.bash_profile; open ~/.bash_profile
Inside the file added this line.
export PATH="$PATH:/usr/local/Cellar/openssl/1.0.2j/bin/openssl"
now it works :)
Jorns-iMac:~ jorn$ openssl version -a
OpenSSL 1.0.2j 26 Sep 2016
built on: reproducible build, date unspecified
//blah blah
OPENSSLDIR: "/usr/local/etc/openssl"
Jorns-iMac:~ jorn$ which openssl
/usr/local/opt/openssl/bin/openssl
The solution above from edwardthesecond worked for me too on Sierra
brew install openssl
cd /usr/local/include
ln -s ../opt/openssl/include/openssl
./configure && make
Other steps I did before were:
installing openssl via brew
brew install openssl
adding openssl to the path as suggested by homebrew
brew info openssl
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
I have a similar case. I need to install openssl via brew and then use pip to install mitmproxy. I get the same complaint from brew link --force. Following is the solution I reached: (without force link by brew)
LDFLAGS=-L/usr/local/opt/openssl/lib
CPPFLAGS=-I/usr/local/opt/openssl/include
PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig
pip install mitmproxy
This does not address the question straightforwardly. I leave the one-liner in case anyone uses pip and requires the openssl lib.
Note: the /usr/local/opt/openssl/lib paths are obtained by brew info openssl
This worked for me:
brew install openssl
cd /usr/local/include
ln -s ../opt/openssl/include/openssl .
By default, homebrew gave me OpenSSL version 1.1 and I was looking for version 1.0 instead. This worked for me.
To install version 1.0:
brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
Then I tried to symlink my way through it but it gave me the following error:
ln -s /usr/local/Cellar/openssl/1.0.2t/include/openssl /usr/bin/openssl
ln: /usr/bin/openssl: Operation not permitted
Finally linked openssl to point to 1.0 version using brew switch command:
brew switch openssl 1.0.2t
Cleaning /usr/local/Cellar/openssl/1.0.2t
Opt link created for /usr/local/Cellar/openssl/1.0.2t
I had the same problem while trying to install newer version of ruby 2.6.5
https://github.com/kelaberetiv/TagUI/issues/86 helps me to solve the problem. This if for macOS catalina Version 10.15.1
Basically, I did update and upgrade homebrew and install openssl and install ruby.
brew update && brew upgrade
brew install openssl
Then create these 2 symlinks
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
then installed ruby 2.6.5
Note: this no longer works due to https://github.com/Homebrew/brew/pull/612
I had the same problem today. I uninstalled (unbrewed??) openssl 1.0.2 and installed 1.0.1 also with homebrew. Dotnet new/restore/run then worked fine.
Install openssl 101:
brew install homebrew/versions/openssl101
Linking:
brew link --force homebrew/versions/openssl101
for me this is what worked...
I edited the ./bash_profile and added below command
export PATH="/usr/local/opt/openssl/bin:$PATH"
export https_proxy=http://127.0.0.1:1087 http_proxy=http://127.0.0.1:1087 all_proxy=socks5://127.0.0.1:1080
works for me
and I think it can solve all the problems like
Failed to connect to raw.githubusercontent.com port 443: Connection refused
The solution might be updating some tools.
Here's my scenario from 2020 with Ruby and Python:
I needed to install Python 3 on Mac and things escalated. In the end, updating homebrew, node and python lead to the problem with openssl. I did not have openssl 1.0 anymore, so I couldn't "brew switch" to it.
So what was still trying to use that old 1.0 version?
It tuned out it was Ruby 2.5.5.
So I just installed Ruby 2.5.8 and removed the old one.
Other things you can try if this is not enough: Use rbenv and pyenv. Clean up gems and formulas. Update homebrew, node, yarn. Upgrade bundler. Make sure your .bash_profile (or equivalent) is set up according to each tool's instructions. Reopen the terminal.

Can't install imagemagick with brew on Mac OS X mavericks

I am using Homebrew v0.9.5 on my Mac OS X version 10.9.4
When I run the command: `brew install imagemagick, this error occurred.
$ brew install imagemagick
==> Installing dependencies for imagemagick: libpng, freetype
==> Installing imagemagick dependency: libpng
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/libpng-1.6.12.mavericks.bottle.tar.gz
curl: (7) Failed connect to downloads.sf.net:443; Operation timed out
Error: Failed to download resource "libpng"
Download failed: https://downloads.sf.net/project/machomebrew/Bottles/libpng-1.6.12.mavericks.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Downloading https://downloads.sf.net/project/libpng/libpng16/1.6.12/libpng-1.6.12.tar.gz
curl: (7) Failed connect to downloads.sf.net:443; Operation timed out
Error: Failed to download resource "libpng"
Download failed: https://downloads.sf.net/project/libpng/libpng16/1.6.12/libpng-1.6.12.tar.gz
I have added --disable-openmp option, it also doesn't go well.
$ brew install imagemagick --disable-openmp
brew doctor command result has no problem.
$ brew doctor
Your system is ready to brew.
Have you tried a
$ brew update
$ brew install imagemagick --disable-openmp --build-from-source
Apparently that seemed to fix it for me on Mac OS 10.8 (Mountain Lion). Previously I checked out the latest imagemagick brew recipe with "brew versions imagemagick" and "git checkout e68e443", see here and here
I'm not certain whether the source of my problem was the same as the OP's, however (though this has an accepted answer already) I'll post this in case this solution works for others.
Using brew install imagemagick, I would encounter the following error:
curl: (52) Empty reply from server Error: Failed to download resource
"libpng" Download failed:
https://downloads.sf.net/project/libpng/libpng16/1.6.16/libpng-1.6.16.tar.xz
Which is similar, if less specific than the OP's message.
As it turned out, I already had a previous version of libpng installed (version 1.5.7). I then ran:
brew upgrade libpng
Followed by another brew install libpng, and this time it succeeded, as it now had the correct version needed.
This problem also occurs because https://downloads.sf.net/project/libpng/libpng16/1.6.16/libpng-1.6.16.tar.xz has a badly configured SSL certificate. Open the link in your browser and see if your browser complains.
If that's the case, you can manually download the file to /Library/Caches/Homebrew and run again.
Source: https://github.com/Homebrew/homebrew/issues/36703
For me it was upgrading to El Capitan. I found the simplest solution was to force remove homebrew:
sudo ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
then to re-install it:
sudo /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
then install imageMajick:
brew install ImageMagick
Depending on your setup you may not want to sudo. For me, its fine. Enjoy a snack while you manipulate images.
In my case the url was simply not correct, with which homebrew wanted to download the required file. I looked it up here http://sourceforge.net/projects/libpng/files/libpng16/older-releases/1.6.16/ by myself and copied it to /Library/Caches/Homebrew like #Dan suggested.
I then run brew install libpng again and it worked.
Follow this:
brew install imagemagick#6
Add below lines in to ~/.bash_profile file
export LDFLAGS="-L/usr/local/opt/imagemagick#6/lib" export
CPPFLAGS="-I/usr/local/opt/imagemagick#6/include" export
PKG_CONFIG_PATH="/usr/local/opt/imagemagick#6/lib/pkgconfig"
Install Rmagick
source ~/.bash_profile
gem install rmagick
If you are an Anaconda/Miniconda user on Mac OSX or Linux, you can install packages like imagemagick using conda.
conda install -c conda-forge imagemagick
https://anaconda.org/conda-forge/imagemagick

Brew cannot link postgresql OSX Yosemite

The steps I followed:
brew install postgresql
Installed it but couldn't link it
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
No such file or directory - /usr/local/Cellar/postgresql/9.3.3/include/informix
Error: No such file or directory - /usr/local/Cellar/postgresql/9.3.3/include/informix
(ve)Hermans-MacBook-Air: hermanstander$ brew config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew
HEAD: e04275e113a52ad1e26e2973f6d29b508ca702be
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit haswell
OS X: 10.10-x86_64
Xcode: 5.1.1
CLT: 6.0.0.0.1.1406926514
Clang: 5.1 build 503
X11: N/A
System Ruby: 2.0.0-481
Perl: /usr/bin/perl
Python: /Users/hermanstander/apps/foo/foo_app/ve/bin/python
Ruby: /usr/bin/rub
Based on a hint here that old symlinks can confuse brew link, please try brew prune; brew link postgresql and see if that resolves your issue.
9.3.3 is an old version of postgresql and I don't see the Homebrew revision you're using in the Homebrew git history? If you have brew updated recently, there is some discussion of this issue here. It's not obvious what's causing the issue (unless it's dead symlinks, discussed above) but it looks like cd /usr/local/Cellar/postgresql; cp -r 9.3.5 9.3.3 will allow brew link postgresql to work, though that's kludgey.
If you haven't updated recently, please brew rm postgresql; brew update and try again. You should be installing 9.3.5.
(I don't suppose it's causing trouble here but, incidentally, running Homebrew with an active Python virtualenv is not supported.)

Resources