Got command not found error when using gcloud

circle.yml

#1

Hi, I’m trying to use gcloud in my project, but seem like my machine not has gcloud installed. Please help. Here is the error I got.

sudo /opt/google-cloud-sdk/bin/gcloud --quiet components update
sudo: /opt/google-cloud-sdk/bin/gcloud: command not found

sudo /opt/google-cloud-sdk/bin/gcloud --quiet components update returned exit code 1

Action failed: sudo /opt/google-cloud-sdk/bin/gcloud --quiet components update

— More info:
Platform: OSX
Circle: 1.0

— And this is the full circle.yml
machine:
xcode:
version: 9.1
ruby:
version: 2.4.2
environment:
XCODE_SCHEME: Klozr
XCODE_WORKSPACE: Klozr.xcworkspace
dependencies:
pre:
- xcrun instruments -w “iPhone 7 (11.0) [” || true
- mkdir -p ./build

- echo $GCLOUD_SERVICE_KEY | base64 --decode > ${HOME}/gcloud-service-key.json
- sudo /opt/google-cloud-sdk/bin/gcloud --quiet components update
- sudo /opt/google-cloud-sdk/bin/gcloud auth activate-service-account --key-file ${HOME}/gcloud-service-key.json
- sudo /opt/google-cloud-sdk/bin/gcloud config set project $GCLOUD_PROJECT
- /opt/google-cloud-sdk/bin/gsutil -m rsync -d -r ${GCLOUD_BUCKET_URL}/${CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH} ./build

override:
- bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3 --without development
cache_directories:
- vendor/bundle
test:
override:
- bundle exec fastlane testci
post:
- /opt/google-cloud-sdk/bin/gsutil -m rsync -d -r ./build {GCLOUD_BUCKET_URL}/{CIRCLE_PROJECT_REPONAME}/${CIRCLE_BRANCH}
deployment:
beta_distribution:
branch: master
commands:
- bundle exec fastlane beta
release:
branch: release
commands:
- bundle exec fastlane release


#2