如何在heroku上执行二进制文件? [英] how to execute binary on heroku?
本文介绍了如何在heroku上执行二进制文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下代码:
@exec = IO.popen(#{Rails.root} / bin / aapt版本)
@result = @ exec.gets
puts @result
命令未找到:app / bin / aapt版本
你有什么想法做到这一点?或者如果你已经做到了这一点?
解决方案
我如何得到这个工作,但要注意,Heroku不支持这个解决方案。 Heroku Support的直接引用是你是你自己的。
- 在应用程序中创建一个bin目录。 b $ b
- 将Debian etch amd64二进制文件添加到此目录。例如,添加名为mongodump的应用程序。
- 让您的代码执行系统调用。示例(注意缺少路径):
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."
- Create a bin directory in your application.
- Add Debian etch amd64 binaries to this directory. For example, add application called mongodump.
- 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屋!
- 让您的代码执行系统调用。示例(注意缺少路径):
查看全文