我可以将系统库(例如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?

查看:100
本文介绍了我可以将系统库(例如libxml2)合并到我可以部署到Heroku的gem(例如nokogiri)中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Nokogiri在翻译UTF-8字符和来自UTF-8字符时遇到了问题,这些字符最终来自libxml2,特别是2.7.6版本,它是Ubuntu 10.04 LTS支持的最高版本。该错误在2.7.7及更高版本中得到修复,但由于我们的应用程序托管在Heroku(基于Ubuntu 10.04的bamboo-ree-1.8.7堆栈)上,因此我们必须使用2.7.6版本,并继续体验错误,除非:


  1. 有人可以/已经破解nokogiri以解决问题。
  2. Ubuntu 10.04支持的libxml2版本(和/或Heroku更新其堆栈中的libxml2)
  3. 我可以想出一种方法让nokogiri使用libxml2的版本,应用程序可以部署到Heroku。

很高兴听到有关1或2的任何反馈,但好奇是否可行3。以下是我所知道的:



我的问题是,我可以包括更高版本的libxml2与应用程序以这种方式编译,供应商的宝石使用它,当我已经提交并将其推送到Heroku?

/ div>

这不是最方便用户使用的解决方案,但是这里是我一次获得定制版本的libpq的方法。我是用雪松做的,但是如果你先进入tmp,它可能会适用于竹子。


  1. heroku run bash

  2. 卷曲您想要构建的源码

  3. 构建它

  4. 将二进制文件从dyno发送出去

  5. 在vendor / whatever中提供构建的二进制文件

  6. heroku config:add LD_LIBRARY_PATH = / app / vendor / whatever


  7. 抱歉,没有更好的方法来获得自定义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:

    1. Someone can/has hacked nokogiri to get around the problem
    2. Canonical bumps the supported libxml2 version for Ubuntu 10.04 (and/or Heroku updates libxml2 in their stack)
    3. 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.

    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

    1. heroku run bash
    2. curl the source of what you want to build
    3. build it
    4. send the binaries out of the dyno
    5. vendor the built binaries in vendor/whatever
    6. heroku config:add LD_LIBRARY_PATH=/app/vendor/whatever

    Sorry there isn't a better way to get custom binaires yet. Good luck.

    这篇关于我可以将系统库(例如libxml2)合并到我可以部署到Heroku的gem(例如nokogiri)中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆