使用Slather和Fastlane

3

我正在尝试使用Fastlane的Slather。

我的项目Gem文件:

source "https://rubygems.org"

gem "fastlane"
gem "slather"

My Fastfile

platform :ios do
  desc "Run unit tests"
  lane :tests do
    scan(workspace: "Home.xcworkspace", device: "iPhone 6s", scheme: "Home", code_coverage: true)
  
  slather(
      output_directory: "fastlane/html",
      workspace: "Home.xcworkspace",
      html: true,
      scheme: "Home",
      proj: "Home.xcodeproj",
      ignore: [ "R.generated.swift", "Pods/*"],
      verbose: true,
      show: true
  )
  end
end

当我运行时,它在运行我的测试后失败,并显示以下消息:

缺少 gem 'slather',请将以下内容添加到您的本地 Gemfile 中:

在您的 Gemfile 中添加 'gem "slather"' 并重新启动 fastlane

如果我运行 gem install slather,我会得到以下结果:

Successfully installed slather-2.4.7
Parsing documentation for slather-2.4.7
Done installing documentation for slather after 0 seconds
1 gem installed

你正在执行什么命令? - janpio
fastlane tests - Tim J
1个回答

2

您需要使用bundle exec fastlane ...,在您的情况下使用bundle exec fastlane tests,以使Gemfile生效。(确保已运行bundle update以安装Gemfile的依赖项)

注:bundle exec可以确保在本地而不是全局安装的情况下运行所需版本的fastlane。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接