2012-08-08 31 views
0

语境:在Heroku的应用程序安装Ruby/GSL

  • 我有一个应用程序,使得大量使用的GSL库及其 Ruby绑定的。
  • 我想将应用程序部署到Heroku。我非常新,通常编程在 ,更少部署,而且Heroku使用起来非常简单, 尤其适用于Rails应用程序。
  • 我在我的笔记本电脑上安装了GSL。我正在使用'gsl'宝石。

问题:

  • 创业板要求GSL库已安装。
  • GSL尚未安装在Heroku环境中。
  • 所以,毫不奇怪,我从Heroku的这个错误后,我git push heroku master

    -----> 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上的应用程序一个易于遵循的解释。

非常感谢!

+0

以下是在自定义buildpack中安装二进制文件的示例:https://github.com/davidjrice/heroku-buildpack-couchbase-ruby/blob/72ec5da13131b799642f0d26fb85de595cb3d5ad/lib/language_pack/ruby。rb – Schneems 2012-08-09 16:27:07

+0

@Schneems据我了解,我分叉了这个buildpack,用GSL二进制文件替换了libvbucket二进制文件,以及libvbucket特有的安装函数以及GSL特有的安装函数,我应该越来越近了? – Tom 2012-08-10 18:32:38

回答

1

嘿汤姆(有两个人叫Tom需要在heroku上使用ruby-gsl有什么可能吗?)我还没有测试它(我真的不知道自己在做什么,吨真的已经准备好一个应用程序尚未来测试它),但也许这会工作:

heroku-buildpack-gsl-ruby

如果不是,那么,我们就会坚持下去;)

这是GSL 1.15这是目前最新的。

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

+0

太棒了!这完全是甜蜜的。 – Tom 2012-10-01 00:31:01

+0

我似乎无法得到它的工作。看代码。它看起来像ruby.rb文件使用gsl 1.15版本。 GSL_VENDOR_URL =“https://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]:http://stackoverflow.com/questions/7379729/problems-installing-gsl-gem – Kruttik 2012-10-14 00:08:07

+0

@Kruttik:是的,但请查看[Packaging Binary Buildpack Dependencies](https://devcenter.heroku。 com/articles/buildpack-binaries)文章。 Heroku使它变得容易。 – willglynn 2012-10-14 00:27:39