有没有可能在Heroku上运行xvfb? [英] Is it possible to run xvfb on Heroku?

查看:137
本文介绍了有没有可能在Heroku上运行xvfb?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Heroku上运行xvfb。在我的Mac上,我使用了dmg来安装它。有没有人有任何想法如何去关于这个Heroku?



我遇到了这些buildpack( http: //github.com/douglasjsellers/heroku-xvfb-buildpack ) - 但按照说明似乎没有解决问题,因为xvfb仍然没有正确安装。另外,我尝试安装xvfbwrapper( https://pypi.python.org/pypi/xvfbwrapper /0.1.0 ),但它仍然不能在Heroku上工作(道歉可能是一个noob问题)。



以下是Heroku关于Heroku的错误消息:

  2015-02-24T02:09:16.035298 + 00:00应用程式[web.6]:CMD = [ '的Xvfb', '-help'] 
2015-02-24T02:09:16.035564 + 00: 00应用程序[web.6]:程序安装错误!
2015-02-24T02:09:16.035302 + 00:00 app [web.6]:OSError = [Errno 2]没有这样的文件或目录

以下是代码:

  temp = tempfile.mkstemp(后缀= 'HTML')
HTML = os.fdopen(温度[0], R +)
html.write(CV)
html.seek(0,0)

display = Display(visible = 0,size =(800,600))
display.start()

#在Selenium上打开文件以加载JavaScript
driver = webdriver.Firefox()
driver.get(file://+ temp [1])$ ​​b $ b


解决方案

是的,这是可能的,但是很复杂。我跟着一些fxtentacle做的(在他们的回答中),但这可能更简单。这些说明提供了最低限度的Xvfb设置;它仍然打印出一堆警告。



使用 heroku-buildpack-apt 安装 xvfb libnotify4 debian软件包。然后使用此buildpack固定的/ usr /斌/ xkbcomp 问题:
https://github.com/captain401/heroku-buildpack-xvfb



然后,可以使用 xvfb-run $ PROGRAM 运行你的应用程序。


I'd like to run xvfb on Heroku. On my mac, I used the dmg to install it. Would anyone have any idea how to go about this on Heroku?

I came across these buildpacks (http://github.com/douglasjsellers/heroku-xvfb-buildpack) - but following the instructions didn't seem to solve the problem as xvfb is still not installed properly. Also, I tried installing the xvfbwrapper (https://pypi.python.org/pypi/xvfbwrapper/0.1.0), but it's still not working on Heroku (apologies for what is potentially a noob question).

Here is the error I get in my logs off of Heroku:

2015-02-24T02:09:16.035298+00:00 app[web.6]: cmd=['Xvfb', '-help']
2015-02-24T02:09:16.035564+00:00 app[web.6]: Program install error! 
2015-02-24T02:09:16.035302+00:00 app[web.6]: OSError=[Errno 2] No such file or directory

Here is the code:

temp = tempfile.mkstemp(suffix='.html')
html = os.fdopen(temp[0], "r+")
html.write(cv)
html.seek(0, 0)

display = Display(visible=0, size=(800, 600))
display.start()

# Open the file on Selenium to load the JavaScript
driver = webdriver.Firefox()
driver.get("file://" + temp[1])

解决方案

Yes, it is possible, but complicated. I followed some of what fxtentacle did (in their answer), but this may be simpler. These instructions provide for a minimal Xvfb setup; it still prints out a bunch of warnings.

Use heroku-buildpack-apt to install the xvfb and libnotify4 debian packages. Then use this buildpack to fix the /usr/bin/xkbcomp issue: https://github.com/captain401/heroku-buildpack-xvfb

Then you can use xvfb-run $PROGRAM to run your application.

这篇关于有没有可能在Heroku上运行xvfb?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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