ruby 库未加载:/opt/local/lib/libssl.1.0.0.dylib (LoadError)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19168842/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-06 06:13:44  来源:igfitidea点击:

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

rubysslrvm

提问by Dave Sag

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.

我刚刚发现我再也不能gem push …了,一些挖掘使我需要更新我的 RVM SSL 证书。

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

我跑了,rvm osx-ssl-certs status all但这给了我:

/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 -vshows I am running the latest RVM (as of today)

rvm -v显示我正在运行最新的 RVM(截至今天)

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-p195however as rvm listgives

奇怪的是,我不知道为什么它指的ruby-2.0.0-p195rvm list

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?

任何想法如何解决这一问题?

采纳答案by mpapis

Your questions mentions three paths /opt/local, /usr/localand /etc/opensslthey belong to Macports, Homebrewand SM Frameworkrespectively.

你的问题中提到三条路径/opt/local/usr/local以及/etc/openssl他们属于MacPorts的自制SM框架分别。

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 macportsto homebrewbetween installing the rubies.

由于最后一个用于构建静态红宝石,它是无害的,与问题无关。另外两个建议您在安装rubies之间从macports切换到自制软件

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

您需要重新安装ruby-2.0.0-p195它仍然引用来自macports的旧路径,您可以使用:

rvm reinstall ruby-2.0.0-p195

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

您可以获得有关它们运行时使用的 rubies 和 openssl 路径的更多详细信息:

rvm --debug osx-ssl-certs update all

回答by Pradeep S

Uninstalling openssl and re-installing it worked for me.

卸载 openssl 并重新安装它对我有用。

brew remove openssl  

and then

进而

brew install openssl

回答by dman

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

尝试运行 'bundle' 我也开始收到 openssl dylib 投诉,尽管路径略有不同。我尝试了其中的大部分,以及其他一些事情。我有 rvm 和 fink 安装的一些损坏的残余物,尽管我曾尝试用 brew 替换它。很多时候我得到

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

However trying to re-install openssl with brew always produced

然而,总是试图用 brew 重新安装 openssl

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

其中引用了不存在的 /sw/lib/libssl.1.0.0.dylib 文件。然后

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

brought my version up from 1.9.1 to

将我的版本从 1.9.1 提升到

$ 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.

但最后我可以在我的项目上运行“捆绑”,它似乎表现得很好。

回答by gsumk

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 founderror for openssl. To solve that, I did

所有版本的 ruby​​ 都适合我,我在 ruby​​ 2.6.5 上有一个项目。然后我收到library not found了openssl的这个错误。为了解决这个问题,我做了

brew update
brew upgrade
brew install openssl

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

然后所有其他版本都停止工作,因为它library not found用于开放 ssl。由于我将 chruby 用于 ruby​​ 版本管理器,因此我删除了版本文件夹并重新安装它们并且它可以工作。

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

Tl; dr更新和升级brew,安装openssl并重新安装ruby版本

回答by luigi7up

In my case it was the Ruby version when bundling:

就我而言,它是捆绑时的 Ruby 版本:

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:

然后我改为ruby-2.0.0-p451

rvm use ruby-2.0.0-p451

and:

和:

bundle

bundle was done successfully ;)

捆绑已成功完成;)

回答by Cristian Zumelzu

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):

Homebrew 将其 Openssl 版本更改为 1.1 天前(Homebrew/homebrew-core@0349a7c 25 和 Homebrew/homebrew-core@b4b9c1c 10)。我们可以将 Openssl 降级到旧版本以在等待新的重建来临时解决此问题(或手动执行):

So I solved like this:

所以我是这样解决的:

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

回答by rii

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 用户在这里,尝试了上面的几个解决方案,但在我卸载我拥有的 ruby​​ 版本并重新安装之前没有任何效果。所以:

rbenv uninstall 2.4.3
rbenv install 2.4.3

fixed my issue and I was able to bundle.

解决了我的问题,我能够捆绑。

回答by d1jhoni1b

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 opensslvia homebrew, bundler reinstall (none of these worked) a simple

在我的情况与ReactJS +节点ENV更新拧一个Rails项目,并花费了大量的时间或者通过重新安装红宝石版本后rbenv(为2.5.1 BTW),并重新安装也openssl通过homebrew,捆绑重新安装(无工作,这些的)的简单

brew update && brew upgrade

brew update && brew upgrade

did the trick!

成功了!

was running OSXand mojave

正在运行OSXmojave

回答by Nate Bosscher

sudo brew update && sudo brew upgrade

worked for me

对我来说有效