cocoapods-plugins icon indicating copy to clipboard operation
cocoapods-plugins copied to clipboard

How to install CocoaPods plugin from local directory?

Open lolgear opened this issue 7 years ago • 6 comments

It would be worth to install and test plugin on test project on local machine.

Is it possible?

lolgear avatar Feb 13 '18 10:02 lolgear

I try

gem install --source https://github.com/CocoaPods -l cocoapods_acknowledgements.gemspec

and

gem install -l cocoapods_acknowledgements.gemspec

result is:

ERROR:  Could not find a valid gem 'cocoapods_acknowledgements.gemspec' (>= 0) in any repository

lolgear avatar Feb 13 '18 11:02 lolgear

I reccomend using a Gemfile, or running gem build NAME.gemspec && gem install pkg/NAME-VERSION.gemspec

segiddins avatar Feb 13 '18 17:02 segiddins

@segiddins thanks! I use Gemfile as simple alternative :) However, it would be nice to see your answer as a part of a readme of this repository ( as core repository for plugins I suppose )

lolgear avatar Feb 13 '18 18:02 lolgear

I have a problem building and installing cocoapods plugins locally. For example, I've downloaded one of the official cocoapods plugins 'cocoapods-appledoc', then I build gem by running: gem build cocoapods-appledoc.gemspec As a result I got 'cocoapods-appledoc-0.1.0.gem' file (one thing I've notice that the size of any gem I build by running 'gem build ' is always 5kb so I think I am missing something at this point but don't know exactly what), and installed it by running: gem install cocoapods-appledoc-0.1.0.gem As a result 'cocoapods-appledoc' gem is installed (appeared in 'gem list'), but when I run 'pod plugins installed' there is no 'cocoapods-appledoc' plugin. If I download 'cocoapods-appledoc-0.1.0.gem' directly from rubygems.org and install it locally it works like a charm. Please sugges what I am doing wrong when building cocoapods plugins?

VladKorzun avatar Apr 18 '18 15:04 VladKorzun

The problem was in gem specification file. In all plugins that I've tried to build locally spec.files were set to 'git ls-files', but because all plugins were downloaded as archive and no git repository was set up, no files were built into gem. The solution is to fork and checkout plugin before building locally or set spec.files to Dir['lib/**/*'] so it refer to local files.

VladKorzun avatar Apr 19 '18 15:04 VladKorzun

create Example Project,new iterm session ,Test Build Plugin [sudo gem build cocoapods-xxx.gemspec && gem install xxx-Version.gem]

DevDragonLi avatar May 23 '21 06:05 DevDragonLi