【问题标题】:Installing Ruby / GSL in Heroku Application在 Heroku 应用程序中安装 Ruby/GSL
【发布时间】:2012-08-08 23:37:32
【问题描述】:

上下文:

  • 我有一个应用程序大量使用 GSL 库及其 红宝石绑定。
  • 我想将应用程序部署到 Heroku。我对编程很陌生 一般,部署少得多,而且 Heroku 使用起来非常简单, 尤其适用于 Rails 应用。
  • 我的笔记本电脑上安装了 GSL。我正在使用“gsl”gem。

问题:

  • gem 要求已安装 GSL 库。
  • GSL 尚未安装在 Heroku 环境中。
  • 所以,不出所料,我在git push heroku master 之后从 Heroku 收到了这个错误

    -----> Heroku receiving push
    -----> Removing .DS_Store files
    -----> Ruby/Rails app detected
    -----> Installing dependencies using Bundler version 1.2.0.rc
           Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
    
    ...
    Installing gsl (1.14.7) with native extensions
    Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
    /usr/local/bin/ruby extconf.rb
    checking gsl version... *** extconf.rb failed ***
    Could not create Makefile due to some reason, probably lack of
    necessary libraries and/or headers.  Check the mkmf.log file for more
    details.  You may need configuration options.
    Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/local/bin/ruby
    extconf.rb:237:in `rescue in <main>': Check GSL>=0.9.4 is installed, and the command "gsl-config" is in search path. (RuntimeError)
    from extconf.rb:138:in `<main>'
    

(可能的)解决方案:

  • 似乎使用 Heroku 的 buildpacks 是可能的途径。 This(打包二进制 buildpack 依赖项)似乎很有希望。
  • 我只是不明白教程中发生了什么,或者如何使用 vulcan。

我的期望:

  • 关于如何使 GSL 库可用于我在 Heroku 上的应用程序的易于理解的说明。

非常感谢!!

【问题讨论】:

  • 这是在自定义 buildpack 中安装二进制文件的示例:github.com/davidjrice/heroku-buildpack-couchbase-ruby/blob/…
  • @Schneems 据我了解,我 fork 这个 buildpack,将 libvbucket 二进制文件替换为 GSL 二进制文件,并将 libvbucket 特有的安装功能替换为 GSL 特有的一些功能,我应该越来越接近了?

标签: heroku gsl buildpack


【解决方案1】:

嘿,汤姆(两个名叫汤姆的人需要在 heroku 上使用 ruby​​-gsl 的可能性有多大?)我还没有测试它(我真的不知道我在做什么,我也不知道确实有一个应用程序准备好来测试它)但也许这会工作:

heroku-buildpack-gsl-ruby

如果没有,好吧,我们会坚持下去;)

现在是最新的 gsl 1.15。

虽然将来会像这样: package_nodejs 代替 gsl 可能会很好(请参阅自述文件的黑客部分)。我可能会很快添加(复制/粘贴,颤抖,所以不干)。

【讨论】:

  • 太棒了!这真是太甜蜜了。
  • 我似乎无法让它工作。看着代码。似乎 ruby​​.rb 文件使用的是 gsl 1.15 版本。 GSL_VENDOR_URL = "s3.amazonaws.com/gsl_bin/gsl-1.15.tgz" 但我不认为 rb-gsl 与 1.15 兼容。见[这个][1]。我分叉了您的存储库以添加 gsl 1.14。当我下载 gsl-1.15.tgz 时,它看起来像一个编译的 linux 包。您能否确认要使用 1.14,我需要预编译 gsl 1.14 包,然后在 buildpack 中使用它? [1]:stackoverflow.com/questions/7379729/problems-installing-gsl-gem
  • @Kruttik:是的,但请查看Packaging Binary Buildpack Dependencies 文章。 Heroku 让它变得简单。
  • @willglynn:感谢您的意见。我尝试使用 vulcan 路由,但在构建 GSL 时遇到错误。我从 GNU 网站上提取了 gsl-1.14,当我运行 vulcan build -v -s 时。 -p /tmp/gsl -c "./configure --disable-shared --prefix=/tmp/gsl && make install",我得到 error-minmax.c:26:28: error: gsl/gsl_minmax.h:没有这样的文件或目录
  • @Thomas- 你是如何通过 vulcan 构建 GSL 的?请指教。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-07-31
  • 2020-09-05
  • 2018-02-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多