1

サーバー (私は root ではない) で、libxslt を にコンパイルしました/home/foo/sw

したがって、次のように宝石をインストールできます。

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.

これをレーキ (およびカピストラーノ) で機能させるにはどうすればよいですか?

4

1 に答える 1

0

とんでもない。まず、rake はパラメータ "rake .... RAILS_ENV=production" のような env を使用します。第二に gems:build rake タスクは追加のパラメーターを渡さない

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

rails/railties/lib/tasks/gems.rake 内。

解決策は、独自のタスクを作成するか、バンドラーを使用することです。

于 2010-09-16T07:25:05.047 に答える