比 Heroku buildpacks 安装本机依赖项更简单的方法?

Simpler way of installing native dependencies than Heroku buildpacks?

我有一个 rails 应用程序,它依赖于 project-honeypot gem,根据我的 Gemfile.lock,它又具有以下依赖关系:

net-dns2 
  packetfu
    network_interface
    pcarub (~> 0.12)

当我推送到我的 heroku 应用程序时,它不会安装 pcarubOther sources 让我得出结论,我缺少 libpcaplibpcap-devel。如果我在这里错了,希望有人能纠正我。

不幸的是,据我所知,除了 heroku buildpacks 的复杂性之外,没有办法 运行 任意 apt-get 命令。有没有更简单的解决方案?

Heroku / pcarub 安装错误:

Building native extensions.  This could take a while...
ERROR:  Error installing pcaprub:
        ERROR: Failed to build gem native extension.

    /app/vendor/ruby-2.0.0/bin/ruby extconf.rb

[*] Running checks for pcaprub_c code...
platform is x86_64-linux
checking for pcap_open_live() in -lpcap... no
checking for pcap_setnonblock() in -lpcap... no
creating Makefile

make "DESTDIR="
compiling pcaprub.c
pcaprub.c:8:18: fatal error: pcap.h: No such file or directory
 #include <pcap.h>
                  ^
compilation terminated.
make: *** [pcaprub.o] Error 1


Gem files will remain installed in /app/vendor/ruby-2.0.0/lib/ruby/gems/2.0.0/gems/pcaprub-0.12.0 for inspection.
Results logged to /app/vendor/ruby-2.0.0/lib/ruby/gems/2.0.0/gems/pcaprub-0.12.0/ext/pcaprub_c/gem_make.out

事实证明,Heroku buildpacks 使用起来极其简单。 Heroku 现在提供 first class support for multiple buildpacks。我需要明确设置 ruby 构建包:

heroku buildpacks:set https://github.com/heroku/heroku-buildpack-ruby.git

然后在 ruby 构建包之前添加 heroku-buildpack-apt

heroku buildpacks:add --index 1 https://github.com/ddollar/heroku-buildpack-apt.git

然后我在项目根目录中名为 Aptfile 的新文件中的依赖项:

libpcap-dev

下次我部署 Heroku 时,在 运行 捆绑安装之前使用新的 buildpack apt-get install libpcap