Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install CocoaPods plugin from local directory? #84

Open
lolgear opened this issue Feb 13, 2018 · 6 comments
Open

How to install CocoaPods plugin from local directory? #84

lolgear opened this issue Feb 13, 2018 · 6 comments

Comments

@lolgear
Copy link

lolgear commented Feb 13, 2018

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

Is it possible?

@lolgear
Copy link
Author

lolgear commented Feb 13, 2018

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

@segiddins
Copy link
Member

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

@lolgear
Copy link
Author

lolgear commented Feb 13, 2018

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

@VladKorzun
Copy link
Contributor

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
Copy link
Contributor

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.

@DevDragonLi
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants