title: Cryptic Error with Fastlane build of MacOS project on CircleCI
body: <p>I am experiencing the below error when building a MacOS project using FastLane on circleCI. I am able to build the project locally using <code>bundle exec fastlane test</code>, so the problem would seem to be related to the CircleCI environment, but am at a loss as to how to track it down. I am able to reproduce it on the command line when I ssh into CircleCI.</p>
  
  <p>Here is the error:</p>
  
  <pre>
  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----
  </pre>
  
  <p>My Fastfile looks like this:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>and my circleci config is this:</p>
  
  <pre><code># .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&gt;/dev/null &gt;&gt; ~/.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&gt;/dev/null &gt;&gt; ~/.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&gt;/dev/null &gt;&gt; ~/.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&gt;/dev/null &gt;&gt; ~/.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
  </code></pre>