如何从修改后的源构建 gem?

How to build gem from modified source?

我在本地下载了 https://github.com/CocoaPods/CocoaPods 并修改了源代码,但现在我想将其构建到 /bin 文件夹中以在本地测试我的修改。我该怎么做才能做到 ..../bin/pod install?

可能需要直接修改 Gemfile 并在安装时将其指向 git 上的 repo。

CocoaPods 是一个 rubygem,如果您使用捆绑器,请在 Gemfile 中指定本地路径。

gem 'cocoapods', :path => '~/modified_local_path'

实际上,CocoaPods 文档描述了使用未发布版本的方法:https://guides.cocoapods.org/using/a-gemfile.html#using-master-cocoapods