The reason that openssl is not linked is that MacOS already has LibreSSL.
It would be good to build PostgreSQL with LibreSSL on OS X, as LibreSSL is
really more secure, but then again, PostgreSQL on OS X should be only for
development purposes.  You may have heard about the heartbleed attack -
LibreSSL is a fork of OpenSSL with older ciphers removed.

One thing you can do is to place openssl in your  LD_LIBRARY_PATH and
DYLD_LIBRARY_PATH:

export LD_LIBRARY_PATH=/usr/local/opt/openssl@3/lib
export DYLD_LIBRARY_PATH=/usr/local/opt/openssl@3/lib


If you need it beyond Terminal, then this should force it:

brew link openssl


On Tue, Apr 12, 2022 at 6:34 AM cecile rougnaux <[email protected]>
wrote:

> My system is OS Mojave 10.14.6, I got homebrew from this command :
>
>  /bin/bash -c "$(curl -fsSL
> https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
>
>
> when I try to install postgresql with the command
>
> brew install postgresql
>
>
> I have this error:
>
>     Error: An exception occurred within a child process:
>       RuntimeError: /usr/local/opt/[email protected] not present or broken
>     Please reinstall [email protected]. Sorry :(
>
>
> When I try to install [email protected] I have this message:
>
>     brew install [email protected]
>     Running `brew update --preinstall`...
>     ==> Auto-updated Homebrew!
>     Updated 1 tap (homebrew/cask).
>     ==> Updated Casks
>     Updated 8 casks.
>
>     Warning: [email protected] 1.1.1n is already installed, it's just not
> linked.
>     To link this version, run:
>       brew link [email protected]
>     ➜  / brew link [email protected]
>     Warning: Refusing to link macOS provided/shadowed software: [email protected]
>     If you need to have [email protected] first in your PATH, run:
>       echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >>
> ~/.zshrc
>
>     For compilers to find [email protected] you may need to set:
>       export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
>       export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
>
>     For pkg-config to find [email protected] you may need to set:
>       export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"
>
>
> And then when I try to force hombrew link openssl, I get this message
>
>     Warning: Refusing to link macOS provided/shadowed software:
> [email protected]
>     If you need to have [email protected] first in your PATH, run:
>       echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >>
> ~/.zshrc
>
>     For compilers to find [email protected] you may need to set:
>       export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
>       export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
>
>     For pkg-config to find [email protected] you may need to set:
>       export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"
>
>
> I added the lines to .zshrc file as suggested:
>
>     export PATH="/usr/local/opt/[email protected]/bin:$PATH"
>     export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
>     export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
>     export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"
>
> But I kept on having the message when retrying to intall postgresql
>
>     Error: An exception occurred within a child process:
>       RuntimeError: /usr/local/opt/[email protected] not present or broken
>
>
> I also tried this command:
>
>     brew reinstall openssl
>
>
> openssl@3 is installed and I get this message:
>
>     openssl@3 is keg-only, which means it was not symlinked into
> /usr/local,
>     because macOS provides LibreSSL.
>
> and then when I try to
>
>     brew install postgresql
>
> I have the same error:
>
> Error: An exception occurred within a child process:
>  RuntimeError: /usr/local/opt/[email protected] not present or broken
> Please reinstall [email protected].
>
>
> and The pg version in my rails gemfile is
> gem "pg", "1.3.5"
> but I just tried brew install pg,
> and bundle install fails also.
> If anyone could help, I am totally stuck here, thanks!
> Cécile
>
>
>

Reply via email to