无法安装gactions CLI [英] Can't install gactions CLI

查看:93
本文介绍了无法安装gactions CLI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装google action CLI.

I'm trying to install the google actions CLI.

文档: https://developers.google.com/actions/tools/gactions-cli

我遵循了此处的命令以及在此处提问/回答.

我下载了Mac x86_64.

I downloaded the Mac x86_64.

然后在其上运行以下命令:Run chmod +x gactions to make the binary executable.

Then ran the following command on it: Run chmod +x gactions to make the binary executable.

它确实将文件转换为可执行文件.当我单击它时,它在终端中打开并执行了某些操作.

It did turn the file into an executable. When I clicked it, it opened in terminal and did something.

但是,在终端的新标签页中,它仍然不了解具体情况.

However in a new tab in terminal it still does not understand the gactions.

我也不使用终端机,而是使用iterm2,因此我尝试在iterm2中打开可执行文件,并收到此错误.

Also I don't use terminal but iterm2, so I tried opening the executable in iterm2 and got this error.

我在这里放置了gactions文件

I placed the gactions file here

我当前的$ PATHs

My current $PATHs

export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export GOOGLE_SDK_PATH="/Users/leongaban/Projects/YumBrands/GoogleHome"
export TERM="xterm-256color"
export NODE_ENV

推荐答案

您下载的gactions文件本身就是可执行文件,而不是安装程序或类似的文件.您可以将其放在PATH中的某个位置,也可以在调用时通过提供完整路径来直接调用它,但是除非您这样做,否则它不会自动可用.

The gactions file you downloaded is the executable itself - not an installer or anything along those lines. You can put it somewhere in your PATH or call it directly by giving the full path when you're calling it, but it will not be automatically available unless you do so.

您可以使用echo $PATH查看PATH.如果愿意,可以将其放在这些目录之一中.

You can see your PATH with echo $PATH. If you wish, you can place it in one of those directories.

如果您希望继续从下载目录中运行它(我这样做,因为我很少使用该命令),则可以打开iterm2命令行并使用完整路径调用gactions.

If you wish to continue to run it out of your Download directory (which I do, since I rarely use the command), you can open an iterm2 command line and call gactions with the full path:

~/Downloads/gactions

或(使用您的示例)

~/Projects/YumBrands/GoogleHome/gactions

或者(也使用您的示例),您可以添加以下行(可能会添加到〜/.zshrc文件中)以引用GoogleHome目录中的gactions命令:

Or (also using your example) you could add the following line (probably to your ~/.zshrc file) to reference the gactions command in the GoogleHome directory:

PATH="$PATH:$HOME/Projects/YumBrands/GoogleHome"

然后您可以打开一个新的终端或iterm2窗口,并确认它在您的路径中

You can then open a new terminal or iterm2 window and confirm that this is in your path

echo $PATH

使用它的通常方法是在开发Action的目录中创建一个目录(我使用〜/Documents/Projects),并让gaction创建默认的action.json文件.可能是这样的:

The normal way to use it would be to create a directory where you are developing your Action (I use ~/Documents/Projects) and have gactions create the default action.json file. Possibly something like this:

mkdir ~/Documents/Projects/new-sample-action
cd  ~/Documents/Projects/new-sample-action
~/Downloads/gactions init

(如果您更新了PATH,则只需在最后一行使用gactions init.)

(If you have updated your PATH, you can just use gactions init for the last line.)

这篇关于无法安装gactions CLI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆