ruby-on-rails - 更新 Heroku Buildpack 以使用 ffmpegthumbnailer 2.2.0

标签 ruby-on-rails bash heroku ffmpeg buildpack

我正在开发的应用程序当前使用的是使用 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/

相关文章:

ruby-on-rails - rails : Sidekiq unknown driver

ruby-on-rails - 在 Rails 中使用 ActiveModel::Serializer - JSON 数据在 json 和索引响应之间不同

.net - 是否有 Groovy 和 Grails 或 Ruby on Rails 的 .NET 等价物?

ruby-on-rails - 使用 Heroku 上的 CarrierWave 将上传的文件提取到 S3

Java Maven 项目 - 错误 R10(启动超时)-> Web 进程在启动后 90 秒内无法绑定(bind)到 $PORT

node.js - pg.connect 不是一个函数?

ruby-on-rails - Rails WEBrick 不将日志写入终端(标准输出)

bash - Homebrew 软件 NoMethodError:OS::Mac:Module 的未定义方法 `prefer_64_bit?'

bash - 相当于命令行中的 exit

node.js - 未处理的 promise 拒绝(拒绝 ID : 1): Error: kill ESRCH