CocoaPods / cocoapods-plugins

Get info about available CocoaPods plugins.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to install CocoaPods plugin from local directory?

lolgear opened this issue · comments

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

Is it possible?

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

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

@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 )

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?

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.

commented

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