This is my script when this script is triggered in bitbucket-pipeline.yml i received error that you cannot run pod as root user
basically -pod install command does not work
this is my gem file in xcode project for iOS
GemFile
source "https://rubygems.org"
gem 'fastlane'
gem 'fastlane-plugin-versioning'
gem "cocoapods", "1.12.1"
gem "xcode-install"
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
Bitbucket pipline error screen shot

bitbucket-pipeline.yml
image: ruby:2.6
pipelines:
custom:
Staging_Build:
- step:
name: Build and Test
script:
- bundle install
- pod install