Warm tip: This article is reproduced from stackoverflow.com, please click
cocoapods podfile react-native ruby swift

How do I solve: "Errno::ENOENT

发布于 2020-03-27 10:20:38

I am trying to merge React-Native into a swift application. I created a new podfile and added in all the dependencies. After trying 'pod install' many times, it will still not install the pods.

I have tried to delete the podfolder and also delete the node folder and run 'npm install' again. I have tried updating my ruby software. Everything that I can find on GitHub and on here that seems applicable I have tried.

   CocoaPods : 1.7.3
        Ruby : ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
    RubyGems : 2.5.2.3
        Host : Mac OS X 10.14.5 (18F132)
       Xcode : 10.2.1 (10E1001)
         Git : git version 2.20.1 (Apple Git-117)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 690c5ee7cf52451dc2c72cde937bc1b92a98cc86

Plugins

cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.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 'LMWPOS' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for LMWPOS
  pod 'Alamofire'
  pod 'AlamofireObjectMapper', '~> 5.0'
  pod 'SwiftyJSON'
  pod 'DLRadioButton'
  pod 'NVActivityIndicatorView'
  pod 'TextFieldEffects'
  pod 'GoogleSignIn'
  pod 'RealmSwift', '~> 3.11.2'
  pod 'NotificationBannerSwift', '~> 1.6.3'
  pod 'MarqueeLabel/Swift', '~> 3.1.6'
  pod 'FBSDKCoreKit', '~> 4.36.0'
  pod 'FBSDKLoginKit', '~> 4.36.0'
  pod 'PromiseKit/Alamofire', '~> 6.0'
  pod 'AlamofireImage'

  # 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', :subspecs => [
    'Core',
    'CxxBridge', # Include this for RN >= 0.47
    'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket', # Needed for debugging
    'RCTAnimation', # Needed for FlatList and animations running on native UI thread
    # Add any other subspecs you want to use in your project
  ]
  # Explicitly include Yoga if you are using RN >= 0.42.0
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  # Third party deps podspec link
  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

end

post_install do |installer|
    installer.pods_project.targets.each do |target|
        if target.name == "React"
            target.remove_from_project
        end
    end
end

I expected it to install the pods and got this:

Error

Errno::ENOENT - No such file or directory @ rb_sysopen - /Users/lmwmarketing/Desktop/LMW-Source-Codes/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:37:in `initialize'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:37:in `open'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/open-uri.rb:37:in `open'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.3/lib/cocoapods/external_sources/podspec_source.rb:19:in `block in fetch'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.3/lib/cocoapods/user_interface.rb:86:in `titled_section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.3/lib/cocoapods/external_sources/podspec_source.rb:11:in `fetch'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.3/lib/cocoapods/installer/analyzer.rb:854:in `fetch_external_source'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.3/lib/cocoapods/installer/analyzer.rb:833:in `block (2 levels) in fetch_external_sources'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.3/lib/cocoapods/installer/analyzer.rb:832:in `each'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.3/lib/cocoapods/installer/analyzer.rb:832:in `block in fetch_external_sources'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.3/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.3/lib/cocoapods/installer/analyzer.rb:831:in `fetch_external_sources'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.3/lib/cocoapods/installer/analyzer.rb:111:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.3/lib/cocoapods/installer.rb:398:in `analyze'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.3/lib/cocoapods/installer.rb:221:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.3/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.3/lib/cocoapods/installer.rb:220:in `resolve_dependencies'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.3/lib/cocoapods/installer.rb:156:in `install!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.3/lib/cocoapods/command/install.rb:51:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.3/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.7.3/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'
Questioner
Elias Wood
Viewed
114
Elias Wood 2019-07-03 22:03

All of the node files were searching for two directories up when it was only one directory up.

  pod 'DoubleConversion', :podspec => './node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => './node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => './node_modules/react-native/third-party-podspecs/Folly.podspec'