Я испытываю указанную ниже ошибку при создании проекта MacOS с использованием FastLane на circleCI. Я могу создать проект локально, используя bundle exec fastlane test
, поэтому проблема, похоже, связана со средой CircleCI, но я не знаю, как ее отследить. Я могу воспроизвести его в командной строке, когда я sh в CircleCI.
Вот ошибка:
bundler: failed to load command: fastlane (/usr/local/bin/fastlane)
NoMethodError: [!] undefined method `each' for nil:NilClass
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.149.1/scan/lib/scan/runner.rb:172:in `copy_simulator_logs'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.149.1/scan/lib/scan/runner.rb:108:in `handle_results'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.149.1/scan/lib/scan/runner.rb:22:in `run'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.149.1/scan/lib/scan/manager.rb:23:in `work'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.149.1/fastlane/lib/fastlane/actions/run_tests.rb:16:in `run'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.149.1/fastlane/lib/fastlane/runner.rb:261:in `block (2 levels) in execute_action'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.149.1/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.149.1/fastlane/lib/fastlane/runner.rb:253:in `block in execute_action'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.149.1/fastlane/lib/fastlane/runner.rb:227:in `chdir'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.149.1/fastlane/lib/fastlane/runner.rb:227:in `execute_action'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.149.1/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.149.1/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing'
Fastfile:26:in `block (2 levels) in parsing_binding'
/Library/Ruby/Gems/2.6.0/gems/fastlane-2.149.1/fastlane/lib/fastlane/lane.rb:33:in `call'
----snip----
Мой Fastfile выглядит так:
default_platform :mac
platform :mac do
before_all do
setup_circle_ci
end
desc "Runs all the tests"
lane :test do
scan(skip_testing: "ChronosUITests")
end
desc "Ad-hoc build"
lane :adhoc do
match(type: "adhoc")
gym(export_method: "ad-hoc")
end
end
и моя конфигурация circleci такова:
# .circleci/config.yml
version: 2.1
jobs:
build-and-test:
macos:
xcode: 11.5.0
environment:
FL_OUTPUT_DIR: output
FASTLANE_LANE: test
steps:
- checkout
# https://support.circleci.com/hc/en-us/articles/360044709573-Swift-Package-Manager-fails-to-clone-from-private-Git-repositories
- run: rm ~/.ssh/id_rsa
- run: for ip in $(dig @8.8.8.8 bitbucket.org +short); do ssh-keyscan bitbucket.org,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts || true
- run: for ip in $(dig @8.8.8.8 github.com +short); do ssh-keyscan github.com,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts || true
# -------
- run: bundle install
- run:
name: Fastlane
command: bundle exec fastlane $FASTLANE_LANE
- store_artifacts:
path: output
- store_test_results:
path: output/scan
adhoc:
macos:
xcode: 11.5.0
environment:
FL_OUTPUT_DIR: output
FASTLANE_LANE: adhoc
steps:
- checkout
# https://support.circleci.com/hc/en-us/articles/360044709573-Swift-Package-Manager-fails-to-clone-from-private-Git-repositories
- run: rm ~/.ssh/id_rsa
- run: for ip in $(dig @8.8.8.8 bitbucket.org +short); do ssh-keyscan bitbucket.org,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts || true
- run: for ip in $(dig @8.8.8.8 github.com +short); do ssh-keyscan github.com,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts || true
# -----
- run: bundle install
- run:
name: Fastlane
command: bundle exec fastlane $FASTLANE_LANE
- store_artifacts:
path: output
workflows:
build-test-adhoc:
jobs:
- build-and-test
- adhoc:
filters:
branches:
only: development
requires:
- build-and-test