- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在我详细说明问题之前,我应该让你知道我已经在 heroku 的 bash (heroku run bash) 上成功安装了 ffmpegthumbnailer。
我正在尝试使用我编写的自定义 Heroku buildpack 构建 ffmpegthumbnailer,但是当我在 bin/compile buildpack 文件中运行 ./configure && make install 时,ffmpegthumbnailer 告诉我它找不到 ffmpeg 库(util,格式、编解码器、比例)并建议我设置 PKG_CONFIG_PATH。所以我设置了 PKG_CONFIG_PATH ,它似乎仍然找不到库。
我尝试过以各种方式设置 PKG_CONFIG_PATH。 echo export,export,直接通过 PKG_CONFIG_PATH=/app 设置...我一直都是用 .configure 命令设置的。我什至将 PKG_CONFIG_PATH 设置为 heroku config var,并尝试通过作为第三个参数传递到 buildpack 的 ENV_DIR 变量来访问它,但我很快意识到我只是将变量 PKG_CONFIG_PATH 设置为名为 PKG_CONFIG_PATH 的文件的内容,即我正在设置 PKG_CONFIG_PATH=/app/vendor...,我已经完成了!这些都没有奏效。此外,正如您在编译文件和日志中看到的那样, echo $PKG_CONFIG_PATH 会打印正确的路径。
我还能做些什么调试?到底是怎么回事?
下面是我的 bin/compile buildpack 文件,以及我将应用程序部署到 heroku 后的日志。
#!/bin/sh
indent() {
sed -u 's/^/ /'
}
echo "-----> Install ffmpeg-thumbnailer"
BUILD_DIR=$1
VENDOR_DIR="vendor"
DOWNLOAD_URL="https://ffmpegthumbnailer.googlecode.com/files/ffmpegthumbnailer-2.0.8.tar.gz"
echo "DOWNLOAD_URL = " $DOWNLOAD_URL | indent
cd $BUILD_DIR
mkdir -p $VENDOR_DIR
cd $VENDOR_DIR
curl -L --silent $DOWNLOAD_URL | tar xz
cd ffmpegthumbnailer-2.0.8/
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/app/vendor/ffmpeg/lib/pkgconfig/"
echo $PKG_CONFIG_PATH
./configure --prefix /app/vendor/ffmpegthumbnailer && make install
echo "exporting PATH and LIBRARY_PATH" | indent
PROFILE_PATH="$BUILD_DIR/.profile.d/ffmpeg-thumbnailer.sh"
mkdir -p $(dirname $PROFILE_PATH)
echo 'export PATH="$PATH:vendor/ffmpeg-thumbnailer/bin"' >> $PROFILE_PATH
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:vendor/ffmpeg-thumbnailer/lib"' >> $PROFILE_PATH
Fetching repository, done.
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 311 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
-----> Fetching custom git buildpack... done
-----> Multipack app detected
=====> Downloading Buildpack: https://github.com/shunjikonishi/heroku-buildpack-ffmpeg
=====> Detected Framework: ffmpeg
-----> Install ffmpeg
DOWNLOAD_URL = http://flect.github.io/heroku-binaries/libs/ffmpeg.tar.gz
exporting PATH and LIBRARY_PATH
=====> Downloading Buildpack: https://github.com/johnklawlor/heroku-buildpack-ffmpeg-thumbnailer
=====> Detected Framework: ffmpeg
-----> Install ffmpeg-thumbnailer
HERE COMES PKG_CONFIG!
/app/vendor/ffmpeg/lib/pkgconfig
DOWNLOAD_URL = https://ffmpegthumbnailer.googlecode.com/files/ffmpegthumbnailer-2.0.8.tar.gz
/app/vendor/ffmpeg/lib/pkgconfig
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 for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking whether make supports nested variables... yes
checking for ANSI C header files... (cached) yes
checking for inttypes.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking whether /usr/bin/ld -m elf_x86_64 accepts --as-needed... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for FFMPEG... no
configure: error: Package requirements (libavutil libavformat libavcodec >= 52.26.0 libswscale) were not met:
No package 'libavutil' found
No package 'libavformat' found
No package 'libavcodec' found
No package 'libswscale' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables FFMPEG_CFLAGS
and FFMPEG_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
exporting PATH and LIBRARY_PATH
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-ruby
最佳答案
问题是你设置了PKG_CONFIG_PATH
到一个不存在的目录。请注意 https://github.com/shunjikonishi/heroku-buildpack-ffmpeg创建目录$BUILD_DIR/vendor/ffmpeg
在构建测功机上,而不是 /app/vendor/ffmpeg
, 和 $BUILD_DIR
类似于 /tmp/build_<hash>
.
如果您将变量分配更改为
export PKG_CONFIG_PATH="$BUILD_DIR/vendor/ffmpeg/lib/pkgconfig"
configure
会找到图书馆。
$BUILD_DIR
中的内容。构建之后是您的应用程序 slug,将位于
/app
在生产测功机上。因此,
ffmpeg
的路径是
$BUILD_DIR/vendor/ffmpeg
在构建期间,但
/app/vendor/ffmpeg
在生产过程中。
./configure --prefix /app/vendor/ffmpegthumbnailer && make install
ffmpegthumbnailer
至
/app/vendor/ffmpegthumbnailer
这在您的应用程序段之外。然而,它确实是您在生产过程中想要的位置,但这意味着它必须在
$BUILD_DIR/vendor/ffmpegthumbnailer
中。在构建结束时。
/app
。然后将完成的安装目录复制到
$BUILD_DIR
.因此,你可以做
./configure --prefix /app/vendor/ffmpegthumbnailer && make install
mkdir -p "$BUILD_DIR"/vendor/ffmpegthumbnailer
cp -R /app/vendor/ffmpegthumbnailer/ "$BUILD_DIR"/vendor/ffmpegthumbnailer
./configure --prefix
使用的路径是运行时有效的路径(否则运行时出现问题),
和 我们的应用程序 slug 中包含安装。
PATH
和
LD_LIBRARY_PATH
然后在运行时像你一样完成:
echo 'export PATH="$PATH:/app/vendor/ffmpegthumbnailer/bin"' >>"$PROFILE_PATH"
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/app/vendor/ffmpegthumbnailer/lib"' >>"$PROFILE_PATH"
$BUILD_DIR
(构建)==
/app
(生产)
关于bash - 如何在 Heroku buildpack 中设置 CONFIG_PATH,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22995788/
目标 我对 Heroku 很陌生,我正在尝试部署一个 非常简单的网站进入 Heroku。 网站结构 如您所见,我并不是要在这里部署复杂的 Node.js 或 Laravel 站点。 脚步 我当然登录到
我的应用程序依赖于nodejs和phantomjs,我遵循trigoman的答案Is there a working nodejs/phantomjs Heroku buildpack? . 但我陷入
我用 python 写了一个网络爬虫。 为了部署到heroku上,我引用了这篇文章。 https://www.andressevilla.com/running-chromedriver-with-p
我目前正在开发一个 Spring Native 应用程序,它正在使用 paketo buildpack 进行构建并生成一个 Docker 镜像。 我想知道是否可以通过添加第三方工具(例如 Datado
我正在尝试部署我在 ASP.Net 4.6.1 中构建的应用程序。所以我正在使用 HWC Buildpack。下面是我的 manifest.yml --- applications: - name:
我有一个带有 gradle 和 spring boot 的 java 项目,我想将其部署到 Heroku。 我使用 gradle war 在本地创建了 myApp.war(我必须在本地部署,因为我使用
我正在使用heroku-buildpack-multi: BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi.git 我尝试
我正在处理 a Spring Boot application应该使用 Cloud Native Build Packs/Paketo.io 将其打包到 OCI 容器中。我使用 GitHub Acti
我正在尝试部署用 swift 编写的 Web 服务,我没有看到 Web 根文件夹,也不知道在哪里创建该文件夹。有人尝试过,请帮我复制源代码并启动服务器。 最佳答案 那么,您能告诉我到目前为止您在启动和
所以我正在学习如何将 git 与 Heroku 一起使用,但我似乎无法 git push 我的设置 repo 协议(protocol)。所以我通过这样做将 buildpack 设置为 ruby,将
我正在尝试将我的 Discord Bot 部署到 Heroku,并且我已经成功地将我的 Github 帐户链接到 Heroku。它可以成功找到我正在尝试部署的存储库,但是当我尝试手动部署时,它会给我错
我正在制作一个机器人,它将一个 mp3 文件输出到与 discord.py 的语音聊天中,它通过以下方式在本地工作:vc.play(discord.FFmpegPCMAudio(executable=
我正在尝试将 compass 构建包推送到 heroku 服务器,https://github.com/stephanmelzer/heroku-buildpack-nodejs-grunt-comp
我正在尝试安装 texlive-full通过制作自定义 buildpack 在 heroku 上打包。我正在开发 django 应用程序,所以我目前使用的版本是 heroku-buildpack-py
我想用运行的Procfile部署应用程序 web: node myapp.js 在myapp.js使用phantomjs-node运行 headless Webkit内容的情况下,将结果返回到浏览器请
我正在尝试在 Heroku 上安装 M2Crypto。这依赖于安装的 SWIG。 我创建了一个 custom compiled swig executable和一个 custom buildpack
当我跑 git push heroku master这就是我得到的: C:\Users\Emanuele-PC\Desktop\project-mm-beta>git push heroku mast
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,因为
我正在为 heroku-buildpack-fantom 编写一个自定义 Heroku buildpack ( Fantom ) ,作为 compile 脚本的一部分,我下载了一个 .zip 文件(从
我正在尝试使用专门为其定制的heroku buildpack 来构建一个C 应用程序。问题是,编译后到达最后阶段 -----> Installing 并失败。有人能够解释我需要做什么才能成功部署它吗?
我是一名优秀的程序员,十分优秀!