8

我无法在Heroku上安装XML::LibXSLT。尽管在 Heroku stack cedar 和 cedar-14 中被列为已安装的 Ubuntu 软件包,但似乎没有安装所需的库。在这个问题中报告了类似的问题,但在 Heroku 上没有报告,并且不允许安装新的 Ubuntu 软件包。gdbm

要重现该错误,请创建一个最小存储库,其中需要 XML::LibXSLT cpanfile

$ git init
$ echo 'requires "XML::LibXSLT";' > cpanfile
$ echo 'sub { [200,[], ['Hello World']] }' > app.psgi
$ git add cpanfile app.psgi
$ git commit -m "initial commit"

使用 heroku-buildpack-perl 创建一个新的 Heroku 应用程序以运行cpanm

$ heroku create --stack cedar --buildpack https://github.com/miyagawa/heroku-buildpack-perl.git
$ git push heroku master

错误日志包含

! Installing XML::LibXSLT failed. See /app/.cpanm/work/1412752363.1663/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Module 'XML::LibXSLT' is not installed
! Bailing out the installation for ..

要获得更详细的错误消息,请尝试手动安装:

$ heroku run cpanm --verbose XML::LibXSLT

失败并出现以下错误

....
LD_RUN_PATH="/usr/lib" cc  -shared -O2 -g -L/usr/local/lib -fstack-protector LibXSLT.o perl-libxml-mm.o  -o blib/arch/auto/XML/LibXSLT/LibXSLT.so   \
   -L/usr/lib -lxslt -lxml2 -lz -lm -lexslt -lgdbm -lgdbm_compat -ldl -lm -lpthread -lc -lcrypt  \

/usr/bin/ld: cannot find -lgdbm
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/XML/LibXSLT/LibXSLT.so] Error 1
FAIL
! Installing XML::LibXSLT failed. See /app/.cpanm/work/1412753360.2/build.log for details. Retry with --force to force install it.

如上所述 Heroku 已经安装了 Ubuntu 软件包libgdbm3libxslt1-dev(用 确认heroku run dpkg --get-selection)所以我想知道为什么编译仍然失败。

4

1 回答 1

2

试试安装libgdbm的开发者包

apt-get install libgdbm-dev

CPAN 通常需要开发包来安装模块。

于 2016-06-16T06:53:50.940 回答