我已经将它下载到我的机器(Debian 7.6.0)并使用本指南编译了 PhantomJS。所以我执行了:
sudo apt-get update
sudo apt-get install build-essential chrpath git-core libssl-dev libfontconfig1-dev libxft-dev
git clone git://github.com/ariya/phantomjs.git
cd phantomjs
git checkout 1.9
./build.sh
然后我从/bin
文件夹中取出二进制文件并将其添加到自定义 buildpack。我将此 buildpack 添加到 heroku,但它因以下错误而崩溃:
/phantomjs: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by ./phantomjs)
所以我在我的机器上做了
ldd bin/phantomjs
我接受了所有依赖项:
root@deepsypotato:/home/viktor# ldd phantomjs.1
linux-vdso.so.1 => (0x00007fffe9f74000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007fd914fcd000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007fd914d96000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd914b91000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fd914989000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd91476d000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fd914465000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd9141e3000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd913fcd000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd913c41000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd915283000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fd913a2a000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007fd913800000)
然后我复制并将其添加到我的自定义 buildpack 中,现在它可以完美运行:) libstdc++.so.6
。/usr/lib/x86_64-linux-gnu/libstdc++.so.6