在针对私有gitlab pod /项目容器执行"pod install"时,我收到了"No podspec found"消息

Isa*_*aac 8 ssh ios cocoapods gitlab podspec

我正处于一些CocoaPods项目的中间,试图构建我自己的私有Pod,可通过我的主项目中的"pod install"访问.这是一个Swift项目,一切似乎都在工作,阅读相应的教程等等......

我必须说,我一直在使用的CocoaPods了一段时间,但我一种新的建设我自己的荚并将其存储在我的私人空间gitlab.

这似乎是我的问题:显然我不知道如何在我的gitlab空间正确存储我最近创建的pod.另外,运行"pod install"无法获取我的podspec文件.

我现在拥有的是一个带有Podfile的主项目.在这个项目中,我有我的pod的下一个简单定义(2个公共(SpkinKit和MBProgressHUD)和1个私有,'commons'):我的Podfile就是这个:

# Uncomment this line to define a global platform for your project
platform :ios, '8.0'

target 'MyBaseApp' do
  # Comment this line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for MyBaseApp

  pod 'SpinKit'
  pod 'MBProgressHUD'
  pod 'commons', :path => 'ssh://git@internal_ip_numeric_address_of_my_gitlab_machine:2222/myusername/ios_commons_pod.git'

end
Run Code Online (Sandbox Code Playgroud)

如果我输入"pod install --verbose",我会得到以下输出:

Fetching external sources
-> Fetching podspec for `commons` from `ssh://git@internal_ip_numeric_address_of_my_gitlab_machine:2222/myusername/ios_commons_pod.git`
[!] No podspec found for `commons` in `ssh://git@internal_ip_numeric_address_of_my_gitlab_machine:2222/myusername/ios_commons_pod.git`
Run Code Online (Sandbox Code Playgroud)

此崩溃不允许pod下载,此过程在此处停止.

什么似乎是错的?据我所知,我在gitlab路径路径中有一个podspec文件.看看这个截图:

我的Gitlab里面的文件结构

我正在使用的URL方案是SSH风格的,即出现在我的gitlab项目主页的根目录(不是HTTP/HTTPS).这是项目的限制,所以我不能使用HTTP.

OTOH我认为我的SSH凭据(和密钥设置)在我的机器上存储正常.为什么?因为我尝试从命令行对该URL使用ssh shell,我可以在屏幕上看到"欢迎myusername"而不指定任何用户名和密码(然后gitlab机器注销那个shell出于安全原因,但这是另一个主题.那是预期的行为).

无论如何,我仍然不确定我应该在我的基本应用程序Podfile中使用什么样的URL格式/路径.

在gitlab里面我有我的文件和podspec文件存储在最后一个截图中显示的结构,但我仍然不能100%确定我是否设置好一切.

我的commons.podspec文件的内容如下:

Pod::Spec.new do |s|

  # 1
  s.platform = :ios
  s.ios.deployment_target = '8.0'
  s.name = "commons"
  s.summary = "commons test fw via pod."
  s.requires_arc = true

  # 2
  s.version = "0.1.0"

  # 3
  s.license = { :type => "MIT", :file => "LICENSE" }

  # 4 - Replace with your name and e-mail address
  s.author = { "Me" => "my@email.address.com" }


  # 5 - Replace this URL with your own Github page's URL (from the address bar)
  s.homepage = "http://internal_ip_numeric_address_of_my_gitlab_machine:8888/myusername"

  # 6 - Replace this URL with your own Git URL from "Quick Setup"
  s.source = { :git => "http://internal_ip_numeric_address_of_my_gitlab_machine:8888/myusername/ios_commons_pod.git", :tag => "#{s.version}"}

  # 7
  s.framework = "UIKit"
  s.dependency 'RNCryptor'

  # 8
  s.source_files = "commons/**/*.{swift}"

  # 9
  s.resources = "commons/**/*.{png,jpeg,jpg,xib,storyboard}"
end
Run Code Online (Sandbox Code Playgroud)

任何提示?

谢谢.

小智 10

您需要做的唯一事情是更改:path =>:git =>,它应该从您的仓库下载pod.

  • 如何?请解释更多 (3认同)