未加载库:libssl.1.0.0.dylib

时间:2014-09-28 13:18:44

标签: ruby libssl

当需要curb Ruby gem时,我遇到以下错误:

$ ruby -v
ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-darwin13.0]

$ gem install curb
Building native extensions.  This could take a while...
Successfully installed curb-0.8.6
1 gem installed

$ irb
irb(main):001:0> require 'curb'
LoadError: dlopen(/Users/scott/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/curb-0.8.6/curb_core.bundle, 9): Library not loaded: libssl.1.0.0.dylib
  Referenced from: /Users/scott/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/curb-0.8.6/curb_core.bundle
  Reason: image not found - /Users/scott/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/curb-0.8.6/curb_core.bundle
    from /Users/scott/.rbenv/versions/2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/scott/.rbenv/versions/2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/scott/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/curb-0.8.6/lib/curl.rb:1:in `<top (required)>'
    from /Users/scott/.rbenv/versions/2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/scott/.rbenv/versions/2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/scott/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/curb-0.8.6/lib/curb.rb:1:in `<top (required)>'
    from /Users/scott/.rbenv/versions/2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `require'
    from /Users/scott/.rbenv/versions/2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
    from /Users/scott/.rbenv/versions/2.1.3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
    from (irb):1
    from /Users/scott/.rbenv/versions/2.1.3/bin/irb:11:in `<main>'
irb(main):002:0> 

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

从您的日志中,看起来您正在使用rbenv。我遇到了同样的问题,并使用rbenv重新安装了相同版本的ruby。

解决了这个问题。资料来源:this SO answer