库未加载 (libcrypto)

Library not loaded (libcrypto)

更新 rubyrubyenv 包后,我遇到了错误。 libcrypto 库未加载。

执行建议的命令时,它似乎正在 ruby /Users/User/.rvm/rubies/ruby-2.4.1 中搜索 openssl。但是在我的系统上我使用 /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

我使用上面的命令诊断了另一个错误(也许这有帮助):

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

我做了一个快速测试:

rvm 2.6.5

确定没有安装ruby-2.6.5,所以安装了:

rvm install "ruby-2.6.5"

您说您正在使用来自 /usr/local/ 的系统 Ruby,但错误消息来自 RVM 安装。

您需要卸载 RVM,或者将系统 Ruby 设置为 RVM 的默认值:

rvm --default use system

更多讨论在这里:
Disable RVM or use Ruby which was installed without RVM?