使用Heroku buildpack无法获得比PATH中的/ usr / bin更高的优先级

时间:2019-05-09 03:59:00

标签: heroku

我正在使用buildpack在Heroku上安装ghostscript 9.21。由于应用程序要求,我必须使用准确的9.21。 Heroku现在默认为我们安装了9.26,所以我需要覆盖它。

https://github.com/brandoncc/heroku-buildpack-ghostscript/blob/master/bin/compile

是我的编译脚本:

#!/usr/bin/env bash
# bin/compile <build-dir> <cache-dir>

echo "-----> Installing Ghostscript 9.21"

BUILD_DIR=$1
PACKAGE="https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs921/ghostscript-9.21-linux-x86_64.tgz"
BINARY="ghostscript-9.21-linux-x86_64/gs-921-linux-x86_64"
LOCATION="$BUILD_DIR/vendor/gs/bin"

mkdir -p $LOCATION
curl $PACKAGE -L -s -o - | tar xzf - -C $LOCATION
mv $LOCATION/$BINARY $LOCATION/gs

echo "-----> Building runtime environment for Ghostscript"

mkdir -p $BUILD_DIR/.profile.d
echo "export PATH=\"\$HOME/vendor/gs/bin:\$PATH\"" > 
$BUILD_DIR/.profile.d/ghostscript.sh

问题是,无论我做什么,我都无法获得比/usr/bin中的PATH高的优先级:

  

/app/vendor/bundle/ruby/2.5.0/bin:/app/bin:/app/vendor/vips/bin:/app/.apt/usr/bin:/usr/local/bin:/ usr / bin:/ bin:/ tmp / codon / vendor / bin:/ app / vendor / bundle / bin:/app/.heroku/node/bin:/app/.heroku/yarn/bin:/ app / vendor / gs / bin:/app/node_modules/.bin


如何使用我要使用的版本?我可以将二进制文件与应用程序打包在一起,但这是我要使用的最后选择,因为我需要该应用程序在Mac和Linux上运行。

0 个答案:

没有答案