在Heroku应用程序中安装Ruby / GSL [英] Installing Ruby / GSL in Heroku Application

查看:75
本文介绍了在Heroku应用程序中安装Ruby / GSL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上下文:




  • 我有一个应用程序,该应用程序大量使用了GSL库及其
    Ruby绑定。

  • 我想将应用程序部署到Heroku。我对使用
    进行编程非常陌生,而部署则要少得多,而且Heroku使用起来非常简单,
    尤其适用于Rails应用。

  • 我已经安装了GSL在我的笔记本电脑上。我正在使用'gsl'宝石。



问题:




  • gem要求已安装GSL库。

  • GSL尚未安装在Heroku环境中。

  • 因此,毫不奇怪的是,在<$ c之后,我从Heroku中得到了这个错误$ c> git push heroku master

      -----> Heroku接收推送
    ----->删除.DS_Store文件
    -----> Ruby / Rails应用检测到
    ----->使用Bundler版本1.2.0.rc
    安装依赖项运行:捆绑安装-不进行开发:测试-路径供应商/捆绑软件--binstubs bin /-部署

    ...
    安装具有本机扩展名的gsl(1.14.7)
    Gem :: Installer :: ExtensionBuildError:错误:无法生成gem本机扩展名。
    / usr / local / bin / ruby​​ extconf.rb
    检查gsl版本... *** extconf.rb失败***
    由于某些原因,可能无法创建Makefile
    个必要的库和/或标头。检查mkmf.log文件以获取更多
    详细信息。您可能需要配置选项。
    提供的配置选项:
    --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
    -不包含make-prog
    --srcdir =。
    --curdir
    --ruby = / usr / local / bin / ruby​​
    extconf.rb:237:在'在< main>'中进行救援:检查GSL> = 0.9.4已安装,并且命令 gsl-config在搜索路径中。 (RuntimeError)来自extconf.rb:138:in'< main>'


  • >

    (可能的)解决方案:




    • 似乎有可能使用Heroku的buildpack路线。
      (打包二进制buildpack依赖项)似乎很有希望。

    • 我只是不了解本教程中发生的事情或如何使用vulcan。



    我希望得到的东西:




    • 如何在我的Heroku上的应用程序中轻松使用GSL库的说明。



    非常感谢!

    解决方案

    嘿汤姆(两个名叫汤姆的人可能需要在heroku上使用ruby-gsl吗?)我尚未对其进行测试(我真的不知道我在做什么,我也不知道)还没有真正准备好应用程序 进行测试),但也许可以使用:



    heroku-buildpack-gsl-ruby



    如果没有,很好,我们将继续进行;)



    这是最新的gsl 1.15。



    未来之类的东西:
    package_nodejs $用b $ b代替gsl可能不错(请参阅自述文件的黑客部分)。我可能会尽快添加(复制/粘贴,颤抖,而不是DRY)。


    Context:

    • I have an application that makes heavy use of the GSL library and its Ruby bindings.
    • I'd like to deploy the app to Heroku. I'm very new to programming in general, much less deployment, and Heroku is very simple to use, especially for Rails apps.
    • I have GSL installed on my laptop. I am using the 'gsl' gem.

    The Problem:

    • The gem requires that the GSL library already be installed.
    • GSL is not already installed in the Heroku environment.
    • So, unsurprisingly, I get this error from Heroku after I 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>'
      

    The (Probable) Solution:

    • It seems that working with Heroku's buildpacks is the likely route. This (packing binary buildpack dependencies) seems promising.
    • I just don't understand what is going on in the tutorial, or how to use vulcan.

    What I am hoping for:

    • An easy-to-follow explanation of how to make the GSL library available to my application on Heroku.

    Thank you so much!!

    解决方案

    Hey Tom (what's the likelihood of two people named Tom needing to use ruby-gsl on heroku?) I've yet to test it out (I really don't exactly know what I'm doing and I don't really have an app ready yet to test it with) but maybe this'll work:

    heroku-buildpack-gsl-ruby

    if not, well, we'll keep at it ;)

    It's gsl 1.15 which is currently the latest.

    Though in the future something like: package_nodejs instead for gsl might be nice (see hacking section of the readme). I'll probably add that soon (copy/paste, shudder, so not DRY).

    这篇关于在Heroku应用程序中安装Ruby / GSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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