【发布时间】:2018-05-21 01:15:07
【问题描述】:
我想在 Heroku 上运行 xvfb。在我的 Mac 上,我使用 dmg 安装它。有人知道如何在 Heroku 上解决这个问题吗?
我遇到了这些 buildpacks (http://github.com/douglasjsellers/heroku-xvfb-buildpack) - 但按照说明似乎并没有解决问题,因为 xvfb 仍未正确安装。另外,我尝试安装 xvfbwrapper (https://pypi.python.org/pypi/xvfbwrapper/0.1.0),但它仍然无法在 Heroku 上运行(对于可能是菜鸟的问题表示歉意)。
这是我在 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
代码如下:
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])
【问题讨论】:
-
我也卡住了。昨天我很容易让它在亚马逊上运行,但它在 heroku 上就是不动。