CocoaPods: Unable to locate the executable `git`

房东的猫 提交于 2019-12-01 12:51:55

问题


I've already installed a pod successfully (SDWebImage) and now trying to add a Library called "MFSideMenu". My Podfile looks the following:

platform :ios, '6.0'

pod 'SDWebImage', '3.2'
pod 'MFSideMenu'

When i do a "pod install", i get the following (error-) output:

Analyzing dependencies
Downloading dependencies
Installing MFSideMenu (0.4.8)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems                 
/custom_require.rb:31: command not found: git config remote.origin.url
[!] Unable to locate the executable `git`

Does anybody know whats the problem here?

Thanks in advance!


回答1:


You don't have git installed. Most software distributed using CocoaPods uses github for hosting and git for distribution. You need to install git.




回答2:


I had the same issue but had git installed - I followed the workaround outlined here: https://github.com/CocoaPods/CocoaPods/issues/6923

Windows binaries end in .exe which CocoaPods doesn't seem to take into account, so editing the file executable.rb (mine was in <RubyLocation>\lib\ruby\gems\2.5.0\gems\cocoapods-1.5.3\lib\cocoapods) and changing the following lines:

bin = File.expand_path(program, path)

to

bin = File.expand_path(program, path) exe = bin + ".exe"

and

if File.file?(bin) && File.executable?(bin)

to

if (File.file?(bin) && File.executable?(bin)) || (File.file?(exe) && File.executable?(exe))

Resolved it.



来源:https://stackoverflow.com/questions/18355710/cocoapods-unable-to-locate-the-executable-git

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!