gpt4 book ai didi

ruby-on-rails - 无法在heroku上找到phantomjs可执行文件

转载 作者:太空宇宙 更新时间:2023-11-03 22:33:42 24 4
gpt4 key购买 nike

我在我的网络应用程序中使用 gem Watir。当我的用户触发一个操作时,watir webdriver 就会打开,并且会在相关网站上进行报废和发布。我不希望我的用户在操作过程中看到浏览器,因此我将 watir 与使用 phantomJS 的 Ghostdriver 一起使用,如下所述:http://watirmelon.com/2013/02/05/watir-webdriver-with-ghostdriver-on-osx-headless-browser-testing/这在本地工作得很好,但是当我尝试在 heroku 部署上使用它时,出现以下错误:

 Selenium::WebDriver::Error::WebDriverError (Unable to find phantomjs executable.):

然后我尝试添加此处指定的 nodeJS 和 phantomJS 构建包 Is there a working nodejs/phantomjs Heroku buildpack?我在控制台中运行了以下命令行:

➜  tennis-match git:(master) heroku buildpacks:set https://github.com/heroku/heroku-buildpack-nodejs.git --app we-tennis-staging
Buildpack set. Next release on we-tennis-staging will use https://github.com/heroku/heroku-buildpack-nodejs.git.
Run `git push heroku master` to create a new release using this buildpack.
➜ tennis-match git:(master) heroku buildpacks:add --index 1 https://github.com/stomita/heroku-buildpack-phantomjs.git --app we-tennis-staging
Buildpack added. Next release on we-tennis-staging will use:
1. https://github.com/stomita/heroku-buildpack-phantomjs.git
2. https://github.com/heroku/heroku-buildpack-nodejs.git
Run `git push heroku master` to create a new release using these buildpacks.

然后推送到我的临时应用程序

➜  tennis-match git:(master) git push staging master                                                 
Everything up-to-date

但我仍然收到错误。您知道如何解决这个问题吗?

最佳答案

这对我有用。

https://gist.github.com/edelpero/9257311

注意:按照上述说明操作后,请确保您有一个包含以下代码的 Procfile:

web: bin/rails server -p $PORT -e $RAILS_ENV

关于ruby-on-rails - 无法在heroku上找到phantomjs可执行文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33146756/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com