【发布时间】:2020-11-02 10:24:09
【问题描述】:
我正在尝试使用我在 Fastfile 中使用的一些辅助函数制作一个 ruby 模块。它看起来如下:
lane :a do |options|
Utils.foo
end
module Utils
def self.foo
get_info_plist_value(...)
end
end
当我尝试运行车道时,我收到此错误:undefined method 'get_info_plist_value' for Utils:Module。
我尝试了以下方法来解决这个问题:
- 在模块定义后添加
extend Utils - 在模块中包含
Fastlane或Fastlane::Actions
这些对我没有帮助。
还有其他方法可以解决这个问题吗?
【问题讨论】:
-
它是一颗宝石吗?命名之间有些混乱,在某处你写了
fastlane和某处fastfile。你能验证一下吗? -
@zhisme,是的,Fastlane 是一颗宝石。 Fastfile 是您使用 Fastlane 编写代码的文件(如我的示例中所示)。这是 Fastlane 文档 - docs.fastlane.tools/getting-started/ios。