2010-09-15 68 views
1

在服務器上(我不是root的),我已經將libxslt編譯爲/home/foo/sw將配置選項傳遞給rake gems:build

所以我安裝我的寶石像這樣:

gem install nokogiri -- --with-xslt-dir=/home/foo/sw 

然而,同樣的技術不耙工作:

$ 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. 

我怎樣才能使這項工作與耙(因而Capistrano)?

回答

0

沒辦法。首先耙子使用env類似參數「rake .... RAILS_ENV = production」。 其次寶石:建立耙任務不傳遞任何額外PARAMS到

Rails::GemBuilder.new(specification, gem_dir).build_extensions 

在軌/ railties/lib中/任務/ gems.rake。

解決方案將編寫自己的任務或使用捆綁器。

+0

我怎麼能用捆綁器做到這一點? – 2010-09-16 14:13:08

+0

'bundle install'命令也可以構建gem擴展。我想有一些方法可以從Capistrano調用它,也可能用一些參數。需要調查。 – gertas 2010-09-17 06:20:08