I'm getting a "No podspec found" message when doing "pod install" against a private gitlab pod/project container

23,262

The only thing you need to do is change :path => to :git => and it should download the pod from your repo.

Share:
23,262
Isaac
Author by

Isaac

Currently based in BCN, I've been developing using MANY technologies for the last 15-20 years. Currently in love with iOS developing, not ignoring all the additional satellite technologies that grow around it. OTOH, Java (whatever flavour) has never really been my cup of tea. "Sad" about it :( Human languages learning enthusiast. I also love teaching random stuff to people.

Updated on July 09, 2022

Comments

  • Isaac
    Isaac almost 2 years

    I'm in the middle of some CocoaPods project trying to build my own private Pod, reachable via "pod install" from my main project. It's a Swift project, and everything seemed to be working, reading the appropriate tutorials, etc...

    I have to say I've been using cocoapods for some time, but I'm kind of new building my own pods and storing them in my private gitlab space.

    And that seems to be my problem: Apparently I don't know how to properly store my recently created pod on my gitlab space. Additionaly, running "pod install" can't fetch my podspec file.

    What I have now is a main project, with a Podfile. In this project I have the next simple definition for my pods (2 public (SpkinKit and MBProgressHUD) and 1 private, 'commons'): My Podfile is this one:

    # 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
    

    If I type "pod install --verbose" I get the following output:

    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`
    

    This crash doesn't allow the pod to get downloaded, and the process stops here.

    What seems to be wrong? As far as I understand I DO have a podspec file in that gitlab path route. Look at this screenshot:

    File Structure inside my Gitlab

    The URL scheme I'm using is the SSH flavoured one, that is the one appearing on the root of my gitlab project homepage (not the HTTP/HTTPS one). This is a limitation of the project, so I can't use the HTTP one.

    OTOH I think my SSH credentials (and key setup) are stored ok on my machine. Why? because I try using a ssh shell against that URL, from the command line, and I can see "Welcome myusername" on screen without specifying any username and password (Then the gitlab machine logouts that shell for security reasons, but that's another theme. That's expected behaviour).

    Whatever, I'm still not sure what exact URL format/path should I use in my base app Podfile.

    Inside gitlab I have my files and podspec file stored with the structure shown in the last screenshot, but I'm still not 100% sure if I've setup everything ok.

    The contents of my commons.podspec file are these:

    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" => "[email protected]" }
    
    
      # 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
    

    Any hint?

    Thanks.

  • Isaac
    Isaac over 7 years
    That's what I ran before all my trouble: pod repo add ios_commons_pod ssh://git@numeric_ip:2222/myusername/ios_commons_pod.git And then pod repo push ios_commons_pod commons.podspec --allow-warnings (The allow-warning thing is because my license files are still fake and non existant)
  • Hodson
    Hodson over 7 years
    Looking at it, I think your problem is that you need to create an actual PodSpec repository that stores your versioned pod specs. I have updated my answer to show the basics of this and also included a link to the tutorial I used when creating a private pod the other week (although based on your PodSpec file I think you have already seen this tutorial :-P)
  • Alex Maina
    Alex Maina over 2 years
    How? Please explain more