Library not loaded: /opt/local/lib/libssl.1.0.0.dylib (LoadError)
Asked Answered
A

10

73

I just discovered I can no longer gem push … any more and some digging led me to a need to update my RVM SSL certs.

I ran rvm osx-ssl-certs status all but that gave me:

/Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': dlopen(/Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/x86_64-darwin12.4.0/openssl.bundle, 9): Library not loaded: /opt/local/lib/libssl.1.0.0.dylib (LoadError)
  Referenced from: /Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/x86_64-darwin12.4.0/openssl.bundle
  Reason: image not found - /Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/x86_64-darwin12.4.0/openssl.bundle
    from /Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/openssl.rb:17:in `<top (required)>'
    from /Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /Users/davesag/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
Certificates for /usr/local/etc/openssl/cert.pem: Up to date.
Certificates for : Old.
Certificates for /etc/openssl/cert.pem: Up to date.

rvm -v shows I am running the latest RVM (as of today)

rvm 1.22.15 (stable) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]

Oddly I am not sure why it's referring to ruby-2.0.0-p195 however as rvm list gives

rvm rubies

   ruby-1.9.3-p392 [ x86_64 ]
   ruby-2.0.0-p195 [ x86_64 ]
=* ruby-2.0.0-p247 [ x86_64 ]

Any ideas how to fix this?

Altazimuth answered 3/10, 2013 at 20:39 Comment(0)
B
50

Your questions mentions three paths /opt/local, /usr/local and /etc/openssl they belong to Macports, Homebrew and SM Framework respectively.

As the last one is used to build static rubies it is harmeless and not related to the problem. The other two suggest that you have switched from macports to homebrew between installing the rubies.

You need to reinstall ruby-2.0.0-p195 which is referring still the old paths from macports, you can do it with:

rvm reinstall ruby-2.0.0-p195

You can get more details about the rubies and openssl paths they use running:

rvm --debug osx-ssl-certs update all
Banting answered 4/10, 2013 at 3:45 Comment(2)
Thanks - I ended up wiping out all the last relics from macports that were hanging about, upgrading rvm, uninstalling ruby-2.0.0-p195 and reinstalling ruby-2.0.0-p247 and it seems happy now.Altazimuth
Note that the version of ruby here is outdated.Mucoprotein
G
116

Uninstalling openssl and re-installing it worked for me.

brew remove openssl  

and then

brew install openssl
Greggrega answered 6/1, 2014 at 8:48 Comment(7)
Also worked for me (and I went as far as imploding and reinstalling rvm). Thanks.Juna
Upgrading to Mavricks broke openssl for me. This fixed it.Metcalfe
Also worked for for me as well! Same issue... Mavericks broke openssl, your advice fixed it!Right
Switched Macbooks at work and going through Mac's migration software, it broke openssl for me. This fixed it for me.Lowkey
Issues related to Mavericks new install seem to be addressed by reinstalling openssl. In my case, after restore from time machine.Santalaceous
removing and then installing fresh worked like a charm. Thank youCasework
Wouldn't brew reinstall openssl do the same?Lifeboat
B
50

Your questions mentions three paths /opt/local, /usr/local and /etc/openssl they belong to Macports, Homebrew and SM Framework respectively.

As the last one is used to build static rubies it is harmeless and not related to the problem. The other two suggest that you have switched from macports to homebrew between installing the rubies.

You need to reinstall ruby-2.0.0-p195 which is referring still the old paths from macports, you can do it with:

rvm reinstall ruby-2.0.0-p195

You can get more details about the rubies and openssl paths they use running:

rvm --debug osx-ssl-certs update all
Banting answered 4/10, 2013 at 3:45 Comment(2)
Thanks - I ended up wiping out all the last relics from macports that were hanging about, upgrading rvm, uninstalling ruby-2.0.0-p195 and reinstalling ruby-2.0.0-p247 and it seems happy now.Altazimuth
Note that the version of ruby here is outdated.Mucoprotein
A
13

Trying to run 'bundle' I also started getting the openssl dylib complaint, though a slightly different path. I tried most of these, and a few other things. I had rvm, and some broken remnants of a fink install, though I'd tried to replace it with brew a while back. Many times I was getting

Library not loaded: /sw/lib/libssl.1.0.0.dylib

However trying to re-install openssl with brew always produced

sudo brew link openssl
Warning: openssl is keg-only and must be linked with --force
Note that doing so can interfere with building software.

or

Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

So it was pretty confusing what I should do. What seemed to help in the end, after much trial, included:

$ rm /Users/dan/.rvm/rubies/default/lib/ruby/1.9.1/x86_64-darwin11.4.0/openssl.bundle

which had references to the non-existent /sw/lib/libssl.1.0.0.dylib file. Then

$ sudo brew update && sudo brew upgrade
$ rvm reset

brought my version up from 1.9.1 to

$ ruby --version
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]

At which point I had to re-install bundler (?)

$ gem install bundler

But finally I could run 'bundle' on my project and it seemed to behave.

Asur answered 8/9, 2014 at 12:12 Comment(1)
I had a similar issue recently with rbenv and just had to do: rm /Users/Jeff/.rbenv/versions/2.6.3/lib/ruby/2.6.0/x86_64-darwin18/openssl.bundle and then: rbenv install 2.6.6Mucin
C
8

Homebrew changed its version of Openssl to 1.1 days ago (Homebrew/homebrew-core@0349a7c 25 and Homebrew/homebrew-core@b4b9c1c 10). We can downgrade Openssl to the older version to temporarily fix this issue while waiting for the new rebuild to come (or do it manually):

So I solved like this:

brew uninstall --ignore-dependencies openssl
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/30fd2b68feb458656c2da2b91e577960b11c42f4/Formula/openssl.rb

UPDATE

From catalina you could get a message like:

Error: Calling Installation of openssl from a GitHub commit URL is disabled!

In this case I recomend you to go to the URL and download the content into a file (with name openssl.rb). Then you can do:

brew install openssl.rb
Capparidaceous answered 7/5, 2020 at 15:40 Comment(2)
After brew update, this error happened for me, this solved the issueStpierre
@muhammedcelik I am on Xcode 12.1 , macOS Bigsur I am just trying to update pods for my project , the above solution din worked what ekzactly u did?Enharmonic
F
6

All the versions of rubies were working for me and I got a project on ruby 2.6.5. then I got this library not found error for openssl. To solve that, I did

brew update
brew upgrade
brew install openssl

Then all the other versions stop working because it library not found for open ssl. Since I am using chruby for ruby version manager, I remove the version folder and reinstall them and it works.

Tl;dr update and upgrade brew, install openssl and reinstall ruby version

Fraud answered 26/11, 2019 at 16:9 Comment(1)
Thanks! definitely helped solve my issue which involved 'uwsgi', so i had to add brew reinstall uwsgi & brew link --overwrite uwsgi, my full solution is here: https://mcmap.net/q/275465/-uwsgi-can-not-load-libssl-1-0-0-dylibDeliver
F
4

rbenv user here, tried a couple of the solutions above but nothing worked until I uninstalled the version of ruby I had and reinstalled. So:

rbenv uninstall 2.4.3
rbenv install 2.4.3

fixed my issue and I was able to bundle.

Fluor answered 7/5, 2020 at 22:24 Comment(1)
rbenv install <version> and selecting y is all that's needed.Eri
A
1

In my case it was the Ruby version when bundling:

I did:

rvm list

output:

   ruby-1.9.3-p448 [ x86_64 ]
   ruby-2.0.0-p247 [ x86_64 ]
   ruby-2.0.0-p353 [ x86_64 ]
   ruby-2.0.0-p451 [ x86_64 ]

and then I changed to ruby-2.0.0-p451:

rvm use ruby-2.0.0-p451

and:

bundle

bundle was done successfully ;)

Ahmednagar answered 25/9, 2014 at 11:34 Comment(0)
K
1

I had a problem with the postgres gem pg and found this issue: https://github.com/ged/ruby-pg/issues/322

This is what I did to fix it:

brew reinstall postgresql
Kiersten answered 19/6, 2020 at 19:29 Comment(1)
Glad I'm not the only one @JunjiZhiKiersten
R
-1

In my case an update with ReactJS + Node env screwed one rails project and after expending a lot of time either reinstalling ruby version via rbenv (was 2.5.1 BTW) and also reinstall openssl via homebrew, bundler reinstall (none of these worked) a simple

brew update && brew upgrade

did the trick!

was running OSX and mojave

Roxi answered 28/1, 2020 at 19:9 Comment(0)
J
-11
brew update && brew upgrade

worked for me

Julietajulietta answered 8/6, 2016 at 15:51 Comment(3)
Never run brew with sudo ! Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system.Geraldina
Brew strongly recommends not to use sudo with it as it can harm the systemPalladio
i don't think brew will allow you to run as sudo, it alway stops meDeliver

© 2022 - 2024 — McMap. All rights reserved.