OpenSSL, RVM, Brew, conflicting error

2019-03-08 20:28发布

问题:

When I run brew doctor in Terminal: I get the following error:

Warning: Some keg-only formula are linked into the Cellar.
You may wish to `brew unlink` these brews:

openssl

If I unlink it, and I type rvm requirements: I will get the following Error.

Checking requirements for osx.
dyld: Library not loaded: @@HOMEBREW_CELLAR@@/openssl/1.0.1f/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/opt/openssl/bin/openssl
  Reason: image not found
Failed reading certificates path for '/usr/local/opt/openssl/bin/openssl' with return       code: ().
RVM autolibs is now configured with mode '2' => 'check and stop if missing',
please run `rvm autolibs enable` to let RVM do its job or run and read `rvm autolibs [help]`
or visit https://rvm.io/rvm/autolibs for more information.
Requirements installation failed with status: 133.

When I run brew unlink openssl, myssl version changed from OpenSSL 1.0.1f 6 Jan 2014 to OpenSSL 0.9.8y 5 Feb 2013

So the question is: How Do I make both Brew Doctor and RVM Requirements Happy ? By having the same OpeenSSL version ? (Assumptions)

回答1:

Try brew reinstall openssl then brew link openssl --force



回答2:

Hengjie is half way there.

The problem is that OSX ships with a version of openssl in /usr/bin. Try this:

$ /usr/bin/openssl version

When homebrew installs openssl it will install it to /usr/local/Cellar/openssl, but by default it won't create the links because of the version conflict that it would create. To crete the links you need to type in:

$ brew link --force openssl

That will create symlinks to the brew version and you should be able to see the new version number by typing this:

$ /usr/local/bin/openssl version

There is one final problem. And that happens if your path variable has /usr/bin ahead of /usr/local/bin. Type this in:

$ echo $PATH

if you see /usr/bin ahead of /usr/local/bin then you need to update your .bash_profile to have something like this in it:

export PATH="/usr/local/bin:$PATH"

That will mean that the new version will be used ahead of the old one.

Warning: the brew package says this "Mac OS X already provides this software and installing another version in parallel can cause all kinds of trouble."

So use at your own risk! I don't actually know what the "all kinds of trouble" is.



回答3:

Had the same error on Mavericks just run "brew remove openssl" then "rvm install ruby"

RVM will install the correct version of OpenSSL now.



回答4:

or DO "which openssl" copy from that location to "/usr/local/opt/openssl/bin/openssl" . then try. thing is "/usr/local/opt/openssl/bin/openssl" have old or corrupted certificate.



回答5:

This seems to be the key point to be aware of, I've copied and pasted into a text doc for later use. 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 does anyone think that this will have consequences for our macs in general? Would a better alternative have been to force the link to the existing openssl? Or is it necessary to have the version from homebrew in order to correctly set up our Ruby development environments. I'm keen to know, as I'm in the process of doing a lot of configuring with the intention of developing a website, and I want my development environment to be as stable as possible. I appreciate any of your responses, after a semester of unix and plenty of other research, there is still so much to know! But knowledge is power!



标签: ruby openssl rvm