3

I have seen posts that you can change the build on Heroku, to use PhantomJS with the Cedar stack, but is it possible to run a headless browser on the unicorn stack?

Dofs
  • 17,737
  • 28
  • 75
  • 123

1 Answers1

8

Yes, and someone already wrote a buildpack for including PhantomJS (the internet and open source are amazing).

If you want to run headless PhantomJS on a Heroku dyno, you will need to:

The multi buildpack must be configured as the official Heroku buildpack. You then need to add the other two buildpack URLs to the .buildpacks file. There are additional details for configuring each buildpack at the links above.

Using this, you should be able to deploy your Rails app, run your PhantomJS code/tests, all on a single dyno headlessly.

Winfield
  • 18,985
  • 3
  • 52
  • 65
  • 1
    Just to be clear, will I be able to run both my app, and PhantomJS on a single Dyno, or does it need a Dyno for each? – Dofs Jan 21 '14 at 20:01
  • The multi-buildpack configuration above will prepare the code needed to run them both (Ruby, bundler, PhantomJS, etc) on a single dyno. If you're planning to execute phantomJS code within your app code, that will work. – Winfield Jan 21 '14 at 20:05
  • Hmm it seems like I am getting timeouts when trying to use Watir with PhantomJS. Don't know if it is due to Watir or PhantomJS. – Dofs Jan 27 '14 at 13:42