阅读背景:

无法使用MAMP找到gcloud实用程序。

来源:互联网 

After attempting to innitialize cluster/kube-up via php using the following code from my local virtual host:

在尝试使用本地虚拟主机的以下代码对集群/ kubeup进行加密后:

$old_path = getcwd();
chdir('/Users/username/kubernetes');
$output = shell_exec('cluster/kube-up.sh');
chdir($old_path);

print_r("<pre>$output</pre>") ;

I received the following error:

我收到了以下错误:

Can't find gcloud in PATH.  Do you wish to install the Google Cloud SDK? [Y/n]

I have gcloud available in my bash_profile. I am also running MAMP and included the path variable in /Applications/MAMP/Library/bin/envvars_* and envvars-std -

我的bash_profile中有gcloud可用。我还在运行MAMP,并将path变量包括在/应用程序/MAMP/Library/bin/envvars_*和envvars-std中。

I am still getting this prompt. Any ideas?

我仍然得到这个提示。什么好主意吗?

1 个解决方案

#1


0  

I managed to bypass this by doing the following:

我通过以下方法绕过了这个问题:

  1. I created a script file in my local kubernetes directory.
  2. 我在本地的kubernetes目录中创建了一个脚本文件。
  3. In the script, I inserted the following code:

    在脚本中,我插入了以下代码:

    export PATH="/Users/username/google-cloud-sdk/bin:$PATH"

    导出路径= " /用户/用户名/ google-cloud-sdk / bin:$路径”

    cluster/kube-up.sh

    集群/ kube-up.sh

This then ran kube-up.sh creating a cluster with values I had set in kubernetes/cluster/gceconfig-default.sh using php.

然后跑kube-up。用我在kubernetes/cluster/gceconfig-default中设置的值创建一个集群。sh使用php。


分享到: