Я пытаюсь выполнить «установку модуля» в папке плагина ReactNative, но получаю сообщение об ошибке, указанное в заголовке. Я использую это в Windows 10. Шаблон ошибки ниже:
C:/Ruby25-x64/bin/pod install
Что ты сделал?
Чего вы ожидали?
Что произошло вместо этого?
CocoaPods : 1.5.3
Ruby : ruby 2.5.3p105 (2018-10-18 revision 65156) [x64-mingw32]
RubyGems : 3.0.2
Host : Unable to find an executable (No such file or directory - sw_vers) ()
Xcode : -version) ()
Git : git version 2.15.0.windows.1
Ruby lib dir : C:/Ruby25-x64/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ f403c4e44587a5045a9ed48ddca2ea6fc108b66b
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
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
use_frameworks!
target 'RNPhotoEditor' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for RNPhotoEditor
pod 'iOSPhotoEditor', :git => 'https://github.com/prscX/photo-editor'
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name.include?('iOSPhotoEditor')
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.1'
end
end
end
end
end
Errno::ENOENT - No such file or directory - env -u GIT_CONFIG git -C "C:/Users/Owner/.cocoapods/repos/master" config --get remote.origin.url
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-core-1.5.3/lib/cocoapods-core/source.rb:448:in ``'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-core-1.5.3/lib/cocoapods-core/source.rb:448:in `repo_git'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-core-1.5.3/lib/cocoapods-core/source.rb:46:in `url'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-core-1.5.3/lib/cocoapods-core/source/manager.rb:347:in `block in source_with_url'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-core-1.5.3/lib/cocoapods-core/source/manager.rb:346:in `each'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-core-1.5.3/lib/cocoapods-core/source/manager.rb:346:in `find'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-core-1.5.3/lib/cocoapods-core/source/manager.rb:346:in `source_with_url'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/sources_manager.rb:18:in `find_or_create_source_with_url'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:873:in `block in sources'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:872:in `map'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:872:in `sources'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:780:in `block in resolve_dependencies'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:64:in `section'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:779:in `resolve_dependencies'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/installer/analyzer.rb:88:in `analyze'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:243:in `analyze'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:154:in `block in resolve_dependencies'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/user_interface.rb:64:in `section'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:153:in `resolve_dependencies'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/installer.rb:116:in `install!'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/command/install.rb:41:in `run'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/lib/cocoapods/command.rb:52:in `run'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/cocoapods-1.5.3/bin/pod:55:in `<top (required)>'
C:/Ruby25-x64/bin/pod:23:in `load'
C:/Ruby25-x64/bin/pod:23:in `<main>'
Если я перейду к этой строке, я найду следующее:
def repo_git(args, include_error: false)
command = "env -u GIT_CONFIG git -C \"#{repo}\" " << args.join(' ')
command << ' 2>&1' if include_error
(`#{command}` || '').strip #<--this line here
end
Если я просто запустил ruby env, я получу следующее:
Traceback (most recent call last):
ruby: No such file or directory -- env (LoadError)
Кроме того, если я запускаю только «env», я получаю сообщение об ожидаемой ошибке «Не найдено»: «env» не распознается как внутренняя или внешняя команда, действующая программа или командный файл. '. Я думаю, это означает, что система не распознает команду env, однако, похоже, необходимо запустить «pod install».
Я немного погуглил, чтобы заставить env работать в Windows, но я почти уверен, что я неправильно ищу свою проблему, так как я не нахожу результатов. Я думаю, что до сих пор я установил ruby, ruby gems и cocoapods, пытаясь заставить работать какой-то плагин RN.
Любая помощь будет оценена.
🤔 А знаете ли вы, что...
Ruby поддерживает различные парадигмы программирования, включая функциональное программирование.
Возможно, это немного поздно, но на всякий случай я столкнулся с той же ошибкой, запустив ту же команду в Linux, с версиями cocoapods 1.5.3
и 1.7.2
.
Единственное решение, которое я нашел, - запустить его на Mac. Отсутствующий файл sw_vers
, похоже, является специфической для Apple утилитой, которая возвращает версию ОС.
Cocoapods документы также упоминают:
CocoaPods manages library dependencies for your Xcode projects.
и хотя нигде об этом нет четкого упоминания, похоже, он не работает должным образом за пределами macOS.