2

I am using gem Watir in my web application. When my user triggers an action the watir webdriver is opened and there's scrapping and posting on websites involved. I dont want my users to see the browser during the action so I am using watir with a ghostdriver using phantomJS as is explained here : http://watirmelon.com/2013/02/05/watir-webdriver-with-ghostdriver-on-osx-headless-browser-testing/ This works perfectly locally, however when I try using it on heroku deploy I get the following error:

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

Then I tried to add nodeJS & phantomJS buildpack as specified here Is there a working nodejs/phantomjs Heroku buildpack? I ran the following command line in the console :

➜  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.

then pushed on my staging app

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

But I still get the error. Do you have any idea on how to fix this ?

Community
  • 1
  • 1
David Geismar
  • 3,152
  • 6
  • 41
  • 80

1 Answers1

0

This worked for me.

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

Note: After following the above instructions, make sure you have a Procfile with the code mentioned below:

web: bin/rails server -p $PORT -e $RAILS_ENV
Pramodh
  • 775
  • 2
  • 9
  • 17