如何在heroku上执行二进制文件? [英] how to execute binary on heroku?

查看:119
本文介绍了如何在heroku上执行二进制文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在heroku上执行一个二进制文件。我遵循这个博客: http://www.verrot.fr/2010/02/24/executing-binary-files-with-ruby-on-rails-and-heroku/

我有以下代码:

  @exec = IO.popen(#{Rails.root} / bin / aapt版本)
@result = @ exec.gets
puts @result





 命令未找到:app / bin / aapt版本

你有什么想法做到这一点?或者如果你已经做到了这一点?

解决方案

我如何得到这个工作,但要注意,Heroku不支持这个解决方案。 Heroku Support的直接引用是你是你自己的。


  1. 在应用程序中创建一个bin目录。 b $ b
  2. 将Debian etch amd64二进制文件添加到此目录。例如,添加名为mongodump的应用程序。
  3. 让您的代码执行系统调用。示例(注意缺少路径):



      system bin / mongodump --help


    真或假从系统调用返回。


    I try to execute a binary on heroku. I follow this blog : http://www.verrot.fr/2010/02/24/executing-binary-files-with-ruby-on-rails-and-heroku/ :

    I have the following code :

    @exec = IO.popen("#{Rails.root}/bin/aapt version")
    @result = @exec.gets
    puts @result
    

    I've got the following error on heroku while it's working on local rails server :

    command not found: app/bin/aapt version
    

    Have you got any idea on a way to do that ? Or if you already done that ?

    解决方案

    How I have gotten this to work, but be warned, Heroku does not support this solution. The direct quote from Heroku Support is "you are on your own."

    1. Create a bin directory in your application.
    2. Add Debian etch amd64 binaries to this directory. For example, add application called mongodump.
    3. Have your code execute system call. Example (note the lack of path):

    system "bin/mongodump --help"
    

    A true or false will be returned from the system call.

    这篇关于如何在heroku上执行二进制文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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