我可以将系统库(例如libxml2)合并到我可以部署到Heroku的gem(例如nokogiri)中吗? [英] Can I incorporate system libraries (e.g. libxml2) I compile against into a gem (e.g. nokogiri) that I can deploy to Heroku?
问题描述
- 有人可以/已经破解nokogiri以解决问题。 Ubuntu 10.04支持的libxml2版本(和/或Heroku更新其堆栈中的libxml2)
- 我可以想出一种方法让nokogiri使用libxml2的版本,应用程序可以部署到Heroku。
很高兴听到有关1或2的任何反馈,但好奇是否可行3。以下是我所知道的:
我的问题是,我可以包括更高版本的libxml2与应用程序以这种方式编译,供应商的宝石使用它,当我已经提交并将其推送到Heroku?
/ div>这不是最方便用户使用的解决方案,但是这里是我一次获得定制版本的libpq的方法。我是用雪松做的,但是如果你先进入tmp,它可能会适用于竹子。
- heroku run bash
- 卷曲您想要构建的源码
- 构建它
- 将二进制文件从dyno发送出去
- 在vendor / whatever中提供构建的二进制文件
- heroku config:add LD_LIBRARY_PATH = / app / vendor / whatever
- Someone can/has hacked nokogiri to get around the problem
- Canonical bumps the supported libxml2 version for Ubuntu 10.04 (and/or Heroku updates libxml2 in their stack)
- I can come up with a way for nokogiri to use a version of libxml2 which I can bundle with the app in such a way that it can be deployed to Heroku.
- Nokogiri can be linked against a library located in a non-standard place - http://nokogiri.org/tutorials/installing_nokogiri.html
- The gem created this way can be installed to vendor/gems, and thus take precedence over system gems
- heroku run bash
- curl the source of what you want to build
- build it
- send the binaries out of the dyno
- vendor the built binaries in vendor/whatever
- heroku config:add LD_LIBRARY_PATH=/app/vendor/whatever
抱歉,没有更好的方法来获得自定义binaires。祝你好运。
Nokogiri has a problem with translating to and from UTF-8 characters that turns out to come from libxml2, specifically version 2.7.6, which is the highest supported version on Ubuntu 10.04 LTS. The bug is fixed in version 2.7.7 and up, but since our app is hosted on Heroku (bamboo-ree-1.8.7 stack, based on Ubuntu 10.04), we have to use version 2.7.6, and continue to experience the bug, unless:
Happy to hear any feedback on 1 or 2 of course, but curious whether 3 is feasible. Here is what I know to be possible:
My question is, can I include the higher versioned libxml2 with the app in such a way that the compiled, vendor'ed gem uses it when I have committed it and pushed it to Heroku?
It's not the most user friendly solution, but here's what I did once to get a custom version of libpq. I did it on cedar, but it'll probably work for bamboo if you go into tmp first
Sorry there isn't a better way to get custom binaires yet. Good luck.
这篇关于我可以将系统库(例如libxml2)合并到我可以部署到Heroku的gem(例如nokogiri)中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!