将配置选项传递给 rake gems:build
在服务器上(我不是 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.
How can I make this work with rake(以及 Capistrano)?
On the server (where I am not root), I have compiled libxslt into /home/foo/sw
.
So I can install my gem like so:
gem install nokogiri -- --with-xslt-dir=/home/foo/sw
However, this same technique doesn't work with rake:
$ rake gems:build -- --with-xslt-dir=/home/foo/sw
(in /home/foo/fooapp/releases/20100915071151)
If I try to force a build, I get the path error:
$ 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.
How can I make this work with rake (and thus Capistrano)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
决不。首先,rake 使用 env,如参数“rake .... RAILS_ENV = Production”。
其次 gems:build rake 任务不会将任何额外的参数传递给
Rails/railties/lib/tasks/gems.rake 。
解决方案是编写自己的任务或使用捆绑器。
No way. Firstly rake uses env like params "rake .... RAILS_ENV=production".
Secondly gems:build rake task doesn't pass any additional params to
In rails/railties/lib/tasks/gems.rake .
The solution would be writing own task or using bundler.