Ruby:LoadError - 找不到类 Digest::SHA1 的库 - 摘要/sha1 [英] Ruby: LoadError - library not found for class Digest::SHA1 -- digest/sha1

查看:102
本文介绍了Ruby:LoadError - 找不到类 Digest::SHA1 的库 - 摘要/sha1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在运行 pod install 时,它在安装 yoga 时遇到问题.好像是我的ruby环境有问题?

When running pod install it runs into a problem when installing yoga. Seems to be a problem with my ruby environment?

$ pod install
Analyzing dependencies
Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`
Fetching podspec for `Permission-Camera` from `../node_modules/react-native-permissions/ios/Camera.podspec`
Fetching podspec for `Permission-LocationAlways` from `../node_modules/react-native-permissions/ios/LocationAlways.podspec`
Fetching podspec for `Permission-LocationWhenInUse` from `../node_modules/react-native-permissions/ios/LocationWhenInUse.podspec`
Fetching podspec for `RNPermissions` from `../node_modules/react-native-permissions`
Fetching podspec for `React` from `../node_modules/react-native/`
Fetching podspec for `yoga` from `../node_modules/react-native/ReactCommon/yoga`

命令

/Users/User/.rbenv/versions/2.3.1/bin/pod install

堆栈

   CocoaPods : 1.5.3
        Ruby : ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
    RubyGems : 2.5.1
        Host : Mac OS X 10.15.1 (19B88)
       Xcode : 11.2.1 (11B500)
         Git : git version 2.24.0
Ruby lib dir : /Users/User/.rbenv/versions/2.3.1/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 7f8d90dc76a619c74dfe5b8d17317599f6175fc3

插件

cocoapods-deintegrate : 1.0.2
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.3.1
cocoapods-try         : 1.1.0

Podfile

# Uncomment the next line to define a global platform for your project
 platform :ios, '9.0'

target 'default' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Your 'node_modules' directory is probably in the root of your project,
  # but if not, adjust the `:path` accordingly
  pod 'React', :path => '../node_modules/react-native/'
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  # Pods for default
  pod 'GoogleIDFASupport'

  # Pods for ReactPushNotifications - Add these lines
  pod 'Firebase/Core'
  pod 'Firebase/Messaging'
  pod 'Firebase/Storage'

  # Pods for react-native-permissions
  pod 'RNPermissions', :path => '../node_modules/react-native-permissions'
  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"
  pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways.podspec"
  pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse.podspec"
end

错误

LoadError - library not found for class Digest::SHA1 -- digest/sha1
/Users/User/.rbenv/versions/2.3.1/lib/ruby/2.3.0/digest.rb:16:in `const_missing'
/Users/User/.rvm/gems/ruby-2.4.1/gems/cocoapods-core-1.5.3/lib/cocoapods-core/specification.rb:566:in `checksum'
/Users/User/.rvm/gems/ruby-2.4.1/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:641:in `block in generate_version_locking_dependencies'
/Users/User/.rvm/gems/ruby-2.4.1/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:640:in `reject'
/Users/User/.rvm/gems/ruby-2.4.1/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:640:in `generate_version_locking_dependencies'
/Users/User/.rvm/gems/ruby-2.4.1/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:87:in `analyze'
/Users/User/.rvm/gems/ruby-2.4.1/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:243:in `analyze'
/Users/User/.rvm/gems/ruby-2.4.1/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:154:in `block in resolve_dependencies'
/Users/User/.rvm/gems/ruby-2.4.1/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:64:in `section'
/Users/User/.rvm/gems/ruby-2.4.1/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:153:in `resolve_dependencies'
/Users/User/.rvm/gems/ruby-2.4.1/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:116:in `install!'
/Users/User/.rvm/gems/ruby-2.4.1/gems/cocoapods-1.5.3/lib/cocoapods/command/install.rb:41:in `run'
/Users/User/.rvm/gems/ruby-2.4.1@global/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Users/User/.rvm/gems/ruby-2.4.1/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:52:in `run'
/Users/User/.rvm/gems/ruby-2.4.1/gems/cocoapods-1.5.3/bin/pod:55:in `<top (required)>'
/Users/User/.rbenv/versions/2.3.1/bin/pod:23:in `load'
/Users/User/.rbenv/versions/2.3.1/bin/pod:23:in `<main>'

推荐答案

我的问题是在主动更新系统后开始的.

For the me problem started after an unsolicited system update.

卸载 ruby​​ 并重新安装它解决了问题:

Uninstalling ruby and installing it again solved the issue:

rbenv uninstall 2.5.1
rbenv install 2.5.1

这篇关于Ruby:LoadError - 找不到类 Digest::SHA1 的库 - 摘要/sha1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆