无法在heroku

时间:2015-10-15 11:01:13

标签: ruby-on-rails node.js phantomjs watir buildpack

我在我的网络应用程序中使用gem Watir。当我的用户触发一个动作时,watir webdriver被打开,并且在相关的网站上有报废和发布。我不希望我的用户在操作过程中看到浏览器,所以我使用phantomJS使用watir和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 buildpack 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

但我仍然得到错误。你对如何解决这个问题有任何想法吗?

1 个答案:

答案 0 :(得分:0)

这对我有用。

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

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

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