美文网首页
pod install Library not loaded:

pod install Library not loaded:

作者: 弹簧有弹力 | 来源:发表于2021-10-01 22:06 被阅读0次

    执行

     pod install
    

    出现一下错误

    /Users/tanhuang/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require': dlopen(/Users/tanhuang/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin16/digest/sha2.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (LoadError)
      Referenced from: /Users/tanhuang/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin16/digest/sha2.bundle
      Reason: image not found - /Users/tanhuang/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin16/digest/sha2.bundle
        from /Users/tanhuang/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require'
        from /Users/tanhuang/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/digest/sha2.rb:14:in `<top (required)>'
        from /Users/tanhuang/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require'
        from /Users/tanhuang/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require'
        from /Users/tanhuang/.rvm/gems/ruby-2.3.0@global/gems/typhoeus-1.3.1/lib/typhoeus.rb:1:in `<top (required)>'
        from /Users/tanhuang/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
        from /Users/tanhuang/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
        from /Users/tanhuang/.rvm/gems/ruby-2.3.0@global/gems/cocoapods-1.9.1/lib/cocoapods/sources_manager.rb:5:in `<top (required)>'
        from /Users/tanhuang/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
        from /Users/tanhuang/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
        from /Users/tanhuang/.rvm/gems/ruby-2.3.0@global/gems/cocoapods-1.9.1/lib/cocoapods/core_overrides.rb:1:in `<top (required)>'
        from /Users/tanhuang/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    

    感觉是ruby版本过低
    升级一下ruby

    先获取一下ruby版本列表

    rvm list known
    
    [ruby-]1.8.6[-p420]
    [ruby-]1.8.7[-head] # security released on head
    [ruby-]1.9.1[-p431]
    [ruby-]1.9.2[-p330]
    [ruby-]1.9.3[-p551]
    [ruby-]2.0.0[-p648]
    [ruby-]2.1[.10]
    [ruby-]2.2[.10]
    [ruby-]2.3[.8]
    [ruby-]2.4[.10]
    [ruby-]2.5[.8]
    [ruby-]2.6[.6]
    [ruby-]2.7[.2]
    [ruby-]3[.0.0]
    

    在执行

    rvm install 2.5.8
    

    执行完成完成之后,可以先查看一下本地所有ruby版本

    rvm list
    
    =* ruby-2.3.0 [ x86_64 ]
       ruby-2.5.8 [ x86_64 ]
    

    目前默认版本是2.3.0
    需要更换一下默认版本

    rvm use 2.5.6 --default
    

    更新成功

    ruby-2.3.0 [ x86_64 ]
    =*  ruby-2.5.8 [ x86_64 ]
    

    最后再执行一下

    pod install
    

    终于解决了

    ps:记录一下,好几个项目都遇到这个情况了。

    相关文章

      网友评论

          本文标题:pod install Library not loaded:

          本文链接:https://www.haomeiwen.com/subject/njzunltx.html