【问题标题】:How to install htop on a Heroku dyno?如何在 Heroku 测功机上安装 htop?
【发布时间】:2020-08-21 10:37:37
【问题描述】:

按照htop的标准安装程序会产生以下错误:

~/htop-2.2.0 $ ./configure 
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/app/htop-2.2.0':
configure: error: C compiler cannot create executables
See `config.log' for more details

【问题讨论】:

  • 您是否能够使用下面显示的任何答案来解决这个问题?如果是这样,请记得accept it。这会向其他用户显示您已找到解决方案。
  • 谢谢。我还没有尝试答案中提到的方法,一旦我能够验证就会更新。

标签: linux heroku htop dyno


【解决方案1】:

你不能在 Heroku 上以这种方式安装东西。

当您heroku run bash 时,您会得到一个one-off dyno,一旦您注销,它就会被丢弃。即使测功机没有被丢弃,它也不是您的应用程序运行的测功机。您要安装的任何内容都需要在构建时安装并包含在您的应用程序 slug 中。

改为通过its Ubuntu package 使用multiple buildpacksheroku-buildpack-apt 安装htop

类似

  • heroku buildpacks:set heroku/python
  • heroku buildpacks:add --index 1 heroku-community/apt

应该适用于 Python 应用程序。根据您希望使用的主要 buildpack 修改第一个命令。

设置好构建包后,在项目的根目录中创建一个新的Aptfile,其中包含您要安装的包的名称:

htop

提交并部署。

您应该会看到 htop 以及您需要的任何其他软件包在构建时安装。

【讨论】:

    猜你喜欢
    • 2017-10-19
    • 2016-10-24
    • 2018-10-15
    • 2015-06-12
    • 2017-01-04
    • 2020-11-01
    • 2017-09-21
    • 2018-06-14
    • 2019-01-31
    相关资源
    最近更新 更多