Library not loaded (libcrypto)

£可爱£侵袭症+ 提交于 2019-12-25 00:38:05

问题


After updating ruby and rubyenv packages I'm facing an error. The libcrypto library is not loaded.

When executing the suggested command it seems that it is searching for openssl in ruby /Users/User/.rvm/rubies/ruby-2.4.1. But on my system I use /usr/local/Cellar/ruby/2.6.5.

$ gem pristine executable-hooks --version 1.3.2
Error loading RubyGems plugin "/Users/User/.rvm/gems/ruby-2.4.1@global/gems/gem-wrappers-1.2.7/lib/rubygems_plugin.rb": dlopen(/Users/User/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /Users/User/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle
  Reason: image not found - /Users/User/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle (LoadError)
ERROR:  Loading command: pristine (LoadError)
    dlopen(/Users/User/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /Users/User/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle
  Reason: image not found - /Users/User/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

I used the above command to diagnose another error (maybe this helps):

$ bundle install --system
Ignoring executable-hooks-1.3.2 because its extensions are not built.  Try: gem pristine executable-hooks --version 1.3.2
Ignoring gem-wrappers-1.2.7 because its extensions are not built.  Try: gem pristine gem-wrappers --version 1.2.7
Ignoring unf_ext-0.0.7.4 because its extensions are not built.  Try: gem pristine unf_ext --version 0.0.7.4
/Users/User/.rbenv/versions/2.3.1/lib/ruby/2.3.0/digest.rb:16:in `const_missing': library not found for class Digest::MD5 -- digest/md5 (LoadError)
    from /Users/User/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/source/rubygems/remote.rb:26:in `cache_slug'
    from /Users/User/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/fetcher/compact_index.rb:107:in `cache_path'
    from /Users/User/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/fetcher/compact_index.rb:83:in `compact_index_client'
    from /Users/User/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/cli.rb:630:in `warn_on_outdated_bundler'
    from /Users/User/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/cli.rb:15:in `ensure in start'
    from /Users/User/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/cli.rb:16:in `start'
    from /Users/User/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/exe/bundle:35:in `block in <top (required)>'
    from /Users/User/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
    from /Users/User/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/exe/bundle:27:in `<top (required)>'
    from /Users/User/.rbenv/versions/2.3.1/bin/bundle:23:in `load'
    from /Users/User/.rbenv/versions/2.3.1/bin/bundle:23:in `<main>'
mdm:ios si$ export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"
mdm:ios si$ bundle install --system
Ignoring executable-hooks-1.3.2 because its extensions are not built.  Try: gem pristine executable-hooks --version 1.3.2
Ignoring gem-wrappers-1.2.7 because its extensions are not built.  Try: gem pristine gem-wrappers --version 1.2.7
Ignoring unf_ext-0.0.7.4 because its extensions are not built.  Try: gem pristine unf_ext --version 0.0.7.4
/Users/User/.rbenv/versions/2.3.1/lib/ruby/2.3.0/digest.rb:16:in `const_missing': library not found for class Digest::MD5 -- digest/md5 (LoadError)
    from /Users/User/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/source/rubygems/remote.rb:26:in `cache_slug'
    from /Users/User/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/fetcher/compact_index.rb:107:in `cache_path'
    from /Users/User/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/fetcher/compact_index.rb:83:in `compact_index_client'
    from /Users/User/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/cli.rb:630:in `warn_on_outdated_bundler'
    from /Users/User/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/cli.rb:15:in `ensure in start'
    from /Users/User/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/cli.rb:16:in `start'
    from /Users/User/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/exe/bundle:35:in `block in <top (required)>'
    from /Users/User/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
    from /Users/User/.rvm/gems/ruby-2.4.1@global/gems/bundler-1.15.1/exe/bundle:27:in `<top (required)>'
    from /Users/User/.rbenv/versions/2.3.1/bin/bundle:23:in `load'
    from /Users/User/.rbenv/versions/2.3.1/bin/bundle:23:in `<main>'

回答1:


I did a quick test:

rvm 2.6.5

To determine that ruby-2.6.5 was not installed, so I installed it:

rvm install "ruby-2.6.5"



回答2:


You say you are using the system Ruby from /usr/local/ yet the error messages are from an RVM installation.

You need to either uninstall RVM, or set the system Ruby as default for RVM:

rvm --default use system

More discussion here:
Disable RVM or use Ruby which was installed without RVM?



来源:https://stackoverflow.com/questions/59033566/library-not-loaded-libcrypto

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!