【问题标题】:How to install Terragrunt 0.19.x version on Mac book如何在 Mac book 上安装 Terragrunt 0.19.x 版本
【发布时间】:2019-08-26 05:19:41
【问题描述】:

如何在 Macbook 上安装 terragrunt 0.19.x 版本?

我试过brew install terragrunt,它只下载0.18.x。

选项1:

brew install terragrunt

touch: /usr/local/Homebrew/.git/FETCH_HEAD: Permission denied
fatal: Unable to create '/usr/local/Homebrew/.git/index.lock': Permission denied
fatal: Unable to create '/usr/local/Homebrew/.git/index.lock': Permission denied
error: could not lock config file .git/config: Permission denied
==> Downloading https://homebrew.bintray.com/bottles/terragrunt-0.18.3.mojave.bottle.tar.gz
Already downloaded: /Users/rohithgundala/Library/Caches/Homebrew/downloads/f494cc7ebcfadf5e2610048e6c9f937e0151ff46cf0c226d83118e6d8ba704cc--terragrunt-0.18.3.mojave.bottle.tar.gz
==> Pouring terragrunt-0.18.3.mojave.bottle.tar.gz
????  /usr/local/Cellar/terragrunt/0.18.3: 3 files, 19.6MB

选项2:

# Install Terragrunt
RUN wget -q -O ${BIN_DIR}/terragrunt "https://github.com/gruntwork-io/terragrunt/releases/download/v${TERRAGRUNT_VERSION}/terragrunt_linux _amd64" \
 && chmod +x ${BIN_DIR}/terragrunt

输出:

bin/terragrunt: cannot execute binary file

【问题讨论】:

标签: macos terraform homebrew terragrunt


【解决方案1】:

按照https://brew.sh/ 中的说明安装 Homebrew。

然后运行以下命令:

git clone https://github.com/cunymatthieu/tgenv.git /usr/local/Cellar/tgenv
ln -s /usr/local/Cellar/tgenv/bin/* /usr/local/bin
tgenv install 0.19.31
tfenv use 0.19.31

tgenv 是 Terragrunt 的版本管理器。 https://github.com/cunymatthieu/tgenv/blob/master/README.md

当您需要在同一台机器上使用特定版本或多个版本时,它非常方便。

tfenv 是一个相关工具,对 terraform 命令执行相同的操作:https://github.com/tfutils/tfenv

【讨论】:

    【解决方案2】:

    对于较新版本的 Mac OS,内核是 Darwin,上面的答案不会出现以下错误:-

    zsh: exec format error

    请通过运行命令uname -a 确认并下载特定于该内核“terragrunt_darwin_amd64”的文件,以获取您想要的任何版本。

    所以下面应该可以工作:-

    wget -q -O /bin/terragrunt "https://github.com/gruntwork-io/terragrunt/releases/download/v0.xx.x/terragrunt_darwin_amd64"
    
    chmod +x /bin/terragrunt
    
    terragrunt -v
    

    【讨论】:

      【解决方案3】:

      我找到了答案。

      wget -q -O /bin/terragrunt "https://github.com/gruntwork-io/terragrunt/releases/download/v0.xx.x/terragrunt_linux_amd64"
      
      chmod +x /bin/terragrunt
      
       terragrunt -v
      

      【讨论】:

      • 这不起作用,不应该是正确的答案。 Linux AMD 64 可执行文件与 macOS ABI 不兼容,不应在其中运行。
      猜你喜欢
      • 2017-08-01
      • 2013-07-01
      • 2018-06-20
      • 1970-01-01
      • 2011-12-16
      • 2015-10-09
      • 1970-01-01
      • 1970-01-01
      • 2013-09-29
      相关资源
      最近更新 更多