MeetYouDevs / cocoapods-imy-bin

1.05k stars 245 forks source link

因podfile_generator.rb的podfile_for_spec method不一直导致 pod bin auto错误 #75

Closed y2kbug closed 3 years ago

y2kbug commented 3 years ago

日志报错如下 pod bin auto --all-make /Users/xiong/Downloads/cocoapods-imy-bin-demo-master/Demo/Demo.xcodeproj /Users/xiong/Downloads/cocoapods-imy-bin-demo-master/Demo/Demo /Users/xiong/Downloads/cocoapods-imy-bin-demo-master/Demo/BinArchive.json /Users/xiong/Downloads/cocoapods-imy-bin-demo-master/Demo/.DS_Store /Users/xiong/Downloads/cocoapods-imy-bin-demo-master/Demo/Podfile_local /Users/xiong/Downloads/cocoapods-imy-bin-demo-master/Demo/Demo_test.podspec

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

Command

/usr/local/bin/pod bin auto --all-make

Report

Stack

   CocoaPods : 1.10.0
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
    RubyGems : 3.0.3
        Host : macOS 11.1 (20C69)
       Xcode : 12.2 (12B45b)
         Git : git version 2.28.0
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : example_spec_bin_dev - git - https://github.com/su350380433/example_spec_bin_dev.git @ 04a94cd20abe9ab0cf131b80ddbf35071ad044df

               guangqiang-liu - git - https://github.com/guangqiang-liu/GQSpec.git @ de49a111258dc3423bffcc68cd8a5d09fbb9daaf

               master - git - https://github.com/CocoaPods/Specs.git @ 0fc894eccec1558bb68adae06d4b336e3820466e

               spec_bin - git - git@repo.we.com:turing.xiong/housekeeper_spec_bin_dev.git @ de9b38d309e49ffc1fd37682da8a1df4241032ca

               trunk - CDN - https://cdn.cocoapods.org/
               TubatuRepo - git - git@repo.we.com:ios/tspecsrepo.git @ 009c9753d5a7aa1e7928d81f2d15a0e9a5bdfdce

Plugins

cocoapods-deintegrate                 : 1.0.4
cocoapods-disable-podfile-validations : 0.1.1
cocoapods-generate                    : 2.2.0
cocoapods-imy-bin                     : 0.3.0.11
cocoapods-plugins                     : 1.0.0
cocoapods-search                      : 1.0.0
cocoapods-stats                       : 1.1.0
cocoapods-trunk                       : 1.5.0
cocoapods-try                         : 1.2.0

Podfile

source 'https://github.com/cocoapods/specs.git'

#命令写在这里也是等效, 已移动到Podfile_local中,避免git提交冲突等场景
plugin 'cocoapods-imy-bin'
use_binaries!

target 'Demo' do
  pod 'FMDB'
  pod 'LKDBHelper'

  pod 'YYModel',:podspec => 'https://github.com/ibireme/YYModel/raw/master/YYModel.podspec'

  pod 'YYCache',:podspec => 'https://github.com/ibireme/YYCache/raw/master/YYCache.podspec'

  end

Error

NameError - undefined method `podfile_for_spec' for class `Pod::Generate::PodfileGenerator'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-imy-bin-0.3.0.11/lib/cocoapods-imy-bin/native/podfile_generator.rb:20:in `<class:PodfileGenerator>'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-imy-bin-0.3.0.11/lib/cocoapods-imy-bin/native/podfile_generator.rb:15:in `<module:Generate>'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-imy-bin-0.3.0.11/lib/cocoapods-imy-bin/native/podfile_generator.rb:12:in `<module:Pod>'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-imy-bin-0.3.0.11/lib/cocoapods-imy-bin/native/podfile_generator.rb:11:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-imy-bin-0.3.0.11/lib/cocoapods-imy-bin/native.rb:10:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-imy-bin-0.3.0.11/lib/cocoapods-imy-bin/command/bin.rb:46:in `initialize'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-imy-bin-0.3.0.11/lib/cocoapods-imy-bin/command/bin/auto.rb:46:in `initialize'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:356:in `new'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:356:in `parse'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:352:in `parse'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:352:in `parse'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:330:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours: https://github.com/CocoaPods/CocoaPods/search?q=undefined+method+%60podfile_for_spec%27+for+class+%60Pod%3A%3AGenerate%3A%3APodfileGenerator%27&type=Issues

If none exists, create a ticket, with the template displayed above, on: https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket: https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods... Found no similar issues. To create a new issue, please visit: https://github.com/cocoapods/cocoapods/issues/new

插件PodfileGenerator 2.2.0 版本有对应method为 `podfile_for_specs' image

插件cocoapods-imy-bin-0.3.0.11的podfile_generator.rb 对应method为podfile_for_spec image

现在已通过更改cocoapods-imy-bin-0.3.0.11的podfile_generator.rb 定义method名,没有报错,请问后续有没有好的解决方式

dabing1022 commented 3 years ago

参考这个解决方案:https://github.com/MeetYouDevs/cocoapods-imy-bin/issues/68

y2kbug commented 3 years ago

好的,已解决