我正在开发的应用程序当前使用的是使用 ffmpegthumbnailer 2.0.8 的 buildpack,我需要在 2.1.2 版中添加的功能。我已经 fork 了我们当前使用的 buildpack 的 repo https://github.com/akomic/heroku-buildpack-ffmpegthumbnailer并更新了 bin/compile
文件将 download_url 指向“https://github.com/dirkvdb/ffmpegthumbnailer/archive/2.2.0.tar.gz”,但是当我将我的 fork 存储库添加到应用程序并运行 heroku run "ffmpegthumbnailer -version"
时为了验证它是否有效,我得到了 bash: ffmpegthumbnailer: command not found
错误。
这里是原文bin/compile
:
#!/bin/sh
indent() {
sed -u 's/^/ /'
}
echo "-----> Install ffmpegthumbnailer"
BUILD_DIR=$1
VENDOR_DIR="vendor"
DOWNLOAD_URL="http://www.aksiom.net/stuff/ffmpegthumbnailer_2.0.8-2.bin.tar.gz"
echo "DOWNLOAD_URL = " $DOWNLOAD_URL | indent
cd $BUILD_DIR
mkdir -p $VENDOR_DIR
cd $VENDOR_DIR
curl -L --silent $DOWNLOAD_URL | tar zx
echo "exporting PATH and LIBRARY_PATH" | indent
PROFILE_PATH="$BUILD_DIR/.profile.d/ffmpeg.sh"
mkdir -p $(dirname $PROFILE_PATH)
echo 'export PATH="$PATH:$HOME/vendor/ffmpegthumbnailer_2.0.8-2/bin"' >> $PROFILE_PATH
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/vendor/ffmpegthumbnailer_2.0.8-2/lib"' >> $PROFILE_PATH
这是我在 fork 仓库中更新的 bin/compile:
#!/bin/sh
indent() {
sed -u 's/^/ /'
}
echo "-----> Install ffmpegthumbnailer"
BUILD_DIR=$1
VENDOR_DIR="vendor"
DOWNLOAD_URL="https://github.com/dirkvdb/ffmpegthumbnailer/archive/2.2.0.tar.gz"
echo "DOWNLOAD_URL = " $DOWNLOAD_URL | indent
cd $BUILD_DIR
mkdir -p $VENDOR_DIR
cd $VENDOR_DIR
curl -L --silent $DOWNLOAD_URL | tar zx
echo "exporting PATH and LIBRARY_PATH" | indent
PROFILE_PATH="$BUILD_DIR/.profile.d/ffmpeg.sh"
mkdir -p $(dirname $PROFILE_PATH)
echo 'export PATH="$PATH:$HOME/vendor/ffmpegthumbnailer_2.0.8-2/bin"' >> $PROFILE_PATH
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/vendor/ffmpegthumbnailer_2.0.8-2/lib"' >> $PROFILE_PATH
其他信息:我使用
heroku buildpacks:add <link_to_forked_repo>
添加构建包感谢您的任何帮助!
最佳答案
这是因为指定的原始 akomic tarball 不是源代码,而是已编译二进制文件和库的自定义 zip。注意 compile
脚本没有 make
步骤,例如。没有关于如何创建此自定义 tarball 的文档,但大概如果您使用较新版本的源代码完成相同的过程,然后将其上传到该脚本可以访问它的地方,它将再次工作。我现在正试图弄清楚这一点。
关于ruby-on-rails - 更新 Heroku Buildpack 以使用 ffmpegthumbnailer 2.2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44475180/