将配置选项传递给 rake gems:build

发布于 2024-09-23 23:47:59 字数 964 浏览 0 评论 0原文

在服务器上(我不是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

陌上芳菲 2024-09-30 23:47:59

决不。首先,rake 使用 env,如参数“rake .... RAILS_ENV = Production”。
其次 gems:build rake 任务不会将任何额外的参数传递给

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

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

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

In rails/railties/lib/tasks/gems.rake .

The solution would be writing own task or using bundler.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文