在服务器上(我不是 root),我已将 libxslt 编译为/home/foo/sw
.
所以我可以像这样安装我的gem:
gem install nokogiri -- --with-xslt-dir=/home/foo/sw
但是,同样的技术不适用于 rake:
$ rake gems:build -- --with-xslt-dir=/home/foo/sw
(in /home/foo/fooapp/releases/20100915071151)
如果我尝试强制构建,则会收到路径错误:
$ rake gems:build:force -- --with-xslt-dir=/home/foo/sw
(in /home/foo/fooapp/releases/20100915071151)
rake aborted!
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for xmlParseDoc() in -lxml2... yes
checking for xsltParseStylesheetDoc() in -lxslt... no
-----
libxslt is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
如何使用 rake(以及 Capistrano)进行这项工作?