【问题标题】:LoadError: dlopen(digest/sha1.bundle): Symbol not found: _rb_Digest_SHA1_FinishLoadError:dlopen(digest/sha1.bundle):找不到符号:_rb_Digest_SHA1_Finish
【发布时间】:2013-02-19 12:33:02
【问题描述】:

Ruby 最近停止在我兄弟的机器上工作。

  • gem 命令
  • rails server
  • rails console

全部失败,出现以下错误:

$ irb
irb(main):001:0> require 'digest/sha1'

LoadError: dlopen(~/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/x86_64-darwin12.2.0/digest/sha1.bundle, 9): Symbol not found: _rb_Digest_SHA1_Finish
  Referenced from: ~/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/x86_64-darwin12.2.0/digest/sha1.bundle
  Expected in: flat namespace

 in ~/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/x86_64-darwin12.2.0/digest/sha1.bundle - ~/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/x86_64-darwin12.2.0/digest/sha1.bundle
    from ~/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from ~/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from (irb):1
    from ~/.rbenv/versions/2.0.0-p0/bin/irb:12:in `<main>'

他尝试了不同版本的 Ruby。使用rvm 重新安装所有内容。运行rvm implode 并重新安装rvm。切换到rbenv。通过ruby-build 安装了几个红宝石。 brew install ruby.

所有人都有同样的问题。

如果他卸载了所有的 rubies,/usr/bin/ruby 中操作系统提供的版本就可以工作。但它是 1.8.7。

经过数小时的故障排除后,我们得出了以下解决方案。我希望它可以帮助您避免一些痛苦。

【问题讨论】:

    标签: ruby-on-rails ruby macos rvm rbenv


    【解决方案1】:

    对于像我这样因为这样的错误而来到这里的任何人:

    LoadError: dlopen(/Users/sebkomianos/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin13.0.0/openssl.bundle, 9): Symbol not found: _SSLv2_client_method
    Referenced from: /Users/sebkomianos/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin13.0.0/openssl.bundle
    Expected in: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
    

    一种解决方案 (taken from here) 可能是重新安装您的 ruby​​ 版本。例如:rbenv install 2.0.0-p247

    【讨论】:

    • 重新安装 ruby​​ 对我有用。 unset C_INCLUDE_PATH 不是必需的。
    【解决方案2】:

    可能的解决方案:

    1. $ unset C_INCLUDE_PATH 并重新安装 Ruby

      这是对我有用的解决方案。

      $ echo $C_INCLUDE_PATH

      如果设置了C_INCLUDE_PATH,它将破坏 Ruby 构建。将其从您的环境中移除;暂时使用$ unset C_INCLUDE_PATH,或永久使用(可能在 .bashrc、.profile、.bash_profile 中);然后重新安装红宝石。

    2. 这可能与 OpenSSL、RVM、XCode 的命令行工具 (gcc) 或其他构建问题有关。

      如果之前的解决方案不起作用,请参阅this answer

    【讨论】:

      猜你喜欢
      • 2021-02-01
      • 1970-01-01
      • 2011-03-26
      • 2011-09-01
      • 1970-01-01
      • 2021-06-10
      • 2014-04-11
      • 1970-01-01
      • 2016-03-18
      相关资源
      最近更新 更多