开发者

how to execute binary on heroku?

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/开发者_Python百科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.


Did you make sure the permissions on your local binary allow execution? Git is permissions-aware. If not, you need to make sure the file allows executable permissions (modify the permissions if you must), then add the modified file to git and repush to heroku before trying again. Keep in mind that the user heroku will use to execute the file may or may not be the owner, so you may need to play with them in order to get heroku to recognize it. Just chmod 777 bin/executable_name as a last resort.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜