LoginSignup
0
0

More than 3 years have passed since last update.

【GCP】 Mac に gcloud をインストールする

Last updated at Posted at 2019-05-24

// この記事は、 note に投稿した記事の再掲です。

パスが通らなくて困ったのでメモをします。

ダウンロードとインストールを実行

インストールを実行すると色々聞かれるので、全部 y を選択して Enter していきます。

$ curl https://sdk.cloud.google.com | bash

.bash_profile がなんとか言ってるので、これも Enter する

Enter a path to an rc file to update, or leave blank to use
[/Users/xxxxxxxxx/.bash_profile]:

シェルを再起動する

再起動します

$ exec -l $SHELL

コマンドの場所を確認する

ふつうならこれでインストールできている(コマンドが見つかる)らしい。
しかし私の環境だと見つからなかったので、パスを通します。

$ which gcloud

パスを通す

~/.bash_profile に google-cloud-sdk/path.bash.inc までのパスを追加

$ source /path/to/directory/google-cloud-sdk/path.bash.inc

コマンドの場所を確認する(再)

$ which gcloud

パスを通したら gcloud がおりました

$ which gcloud
/Users/xxxxxxx/google-cloud-sdk/bin/gcloud

参考

公式ドキュメント
Cloud SDK のインストール - 対話型インストーラ

stack overflow
-bash: gcloud: command not found on Mac

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0