OpenSSL不能用gem rubygems或brew或bundle加载库[英] OpenSSL can't load library with gem rubygems or brew or bundle

本文是小编为大家收集整理的关于OpenSSL不能用gem rubygems或brew或bundle加载库的处理方法,想解了OpenSSL不能用gem rubygems或brew或bundle加载库的问题怎么解决?OpenSSL不能用gem rubygems或brew或bundle加载库问题的解决办法?那么可以参考本文帮助大家快速定位并解决问题。

问题描述

我使用 brew 0.9.5,我安装了 rbenv 0.4.0 和 ruby​​-build 用于 ruby​​ 2.1.2.

已经有一段时间没有碰任何东西了,并且在几次 osx 更新之后:

 bundle

给:

/usr/local/Cellar/rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require': dlopen(/usr/local/Cellar/rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/digest/sha1.bundle, 9): Library not loaded: @@HOMEBREW_PREFIX@@/opt/openssl/lib/libcrypto.1.0.0.dylib (LoadError)
  Referenced from: /usr/local/Cellar/rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/digest/sha1.bundle
  Reason: image not found - /usr/local/Cellar/rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/digest/sha1.bundle
    from /usr/local/Cellar/rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /usr/local/Cellar/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/definition.rb:1:in `<top (required)>'
    from /usr/local/Cellar/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler.rb:153:in `definition'
    from /usr/local/Cellar/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/cli/install.rb:76:in `run'
    from /usr/local/Cellar/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/cli.rb:146:in `install'
    from /usr/local/Cellar/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/vendor/thor/command.rb:27:in `run'
    from /usr/local/Cellar/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/vendor/thor/invocation.rb:121:in `invoke_command'
    from /usr/local/Cellar/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/vendor/thor.rb:363:in `dispatch'
    from /usr/local/Cellar/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/vendor/thor/base.rb:440:in `start'
    from /usr/local/Cellar/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/cli.rb:9:in `start'
    from /usr/local/Cellar/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/bin/bundle:20:in `block in <top (required)>'
    from /usr/local/Cellar/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
    from /usr/local/Cellar/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.6.3/bin/bundle:20:in `<top (required)>'
    from /usr/local/Cellar/rbenv/versions/2.1.2/bin/bundle:23:in `load'
    from /usr/local/Cellar/rbenv/versions/2.1.2/bin/bundle:23:in `<main>'

我试过 brew uninstall openssl &&brew install openssl.

我试过 brew link openssl --force.

我尝试升级所有内容.

到目前为止没有任何效果.

我无法启动 puma、捆绑或更新 gems.

gem update --system

ERROR:  Loading command: update (LoadError)
    dlopen(/usr/local/Cellar/rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle, 9): Library not loaded: @@HOMEBREW_PREFIX@@/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/Cellar/rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle
  Reason: image not found - /usr/local/Cellar/rbenv/versions/2.1.2/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

gem -v : 2.4.0

brew --env

HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
MAKEFLAGS: -j4
CMAKE_PREFIX_PATH: /usr/local
CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Library/ENV/pkgconfig/10.9
ACLOCAL_PATH: /usr/local/share/aclocal
PATH: /usr/local/Library/ENV/4.3:/usr/bin:/bin:/usr/sbin:/sbin


brew config

HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: 49e6d09f85a999a4a4d82b2d47bd837ed342d8cb
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit haswell
OS X: 10.9.5-x86_64
CLT: 6.0.0.0.1.1410400753
Clang: 6.0 build 600
X11: 2.7.6 => /opt/X11
System Ruby: 2.0.0-481
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/local/Cellar/rbenv/shims/ruby

brew uses --installed openssl
postgresql  ruby-build

如果有人有线索...我会接受的!

推荐答案

不知道为什么以及如何:

rbenv install 2.1.2
rbenv: /usr/local/Cellar/rbenv/versions/2.1.2 already exists
continue with installation? (y/N) y

现在它可以工作了!只需要重新安装我的 ruby​​,就像它以某种方式重新链接 openssl 一样......

我现在可以再次工作,但只是为了让我知道更多会发生什么,如果有人知道引擎盖下的机制,我会很高兴听到它.

本文地址:https://www.itbaoku.cn/post/786756.html