You can find the version of fastlane that is pre-installed on the stack by checking the system report for the stack you are using. If you need to use a different version, there are two ways to do this depending on if your project uses a Gemfile or not.
Define the required version number in your Gemfile. For example:
gem "fastlane", "2.166.0"
The Fastlane Step will install this version before running any lanes.
Replace the pre-installed version by adding a Script Step to your Workflow with the following commands:
#!/usr/bin/env bashset -ex gem uninstall fastlane --all --executables gem install fastlane --version 2.166.0 --no-document
Make sure that your Fastlane Step has the Should update fastlane gem before run? option set to false.