Install 2.5.0 Beta on Heroku

77 views
Skip to first unread message

Travis Vignon

unread,
Mar 18, 2017, 2:49:16 PM3/18/17
to phantomjs
Hello! First, thanks to the project developers for all of your hard work. This is an excellent product! I needed to be able to use the latest version because I run this both in Linux and macOS, and 2.1.1 and older versions have some issues that seem to have been corrected with 2.5.0. I couldn't find any reliable information on how to deploy 2.5.0 to Heroku, but I was able to get it to work after lots of trial and error. I posted on Stack Overflow, but I wanted to crosspost here in case anyone else wanted this info...

---


Ultimately, I was able to figure it out! There are a few things that you have to do...

  1. 1. Dependencies: You have to use the Heroku Apt buildpack to install the missing dependencies. First, you need to add the buildpack to your app:

    heroku buildpacks:add --index 1 https://github.com/heroku/heroku-buildpack-apt

    Next, you'll create a file in your project root called Aptfile. Here's where we add the missing dependencies for PhantomJS 2.5.0 Beta. 2.5.0 introduces webp support, so we need that. libhyphen0 is required as well, though I'm not sure how it us used. Finally, we use gcc-5and the latest libstdc++6. Contents should look like this:

webp
libhyphen0
https://mirrors.kernel.org/ubuntu/pool/main/g/gcc-5/gcc-5_5.4.1-8ubuntu1_amd64.deb
https://mirrors.kernel.org/ubuntu/pool/main/g/gcc-5/libstdc++6_5.4.0-6ubuntu1~16.04.4_amd64.deb
  1. 2. PhantomJS: Next we grab the latest version of PhantomJS. I've created a fork of the most popular PhantomJS buildpack and updated it for use with 2.5.0 beta. 2.5.0 beta has builds for trusty as well as xenial, so the build pack will detect the Heroku stack and use the appropriate one (though the cedar-16 stack is still in beta at the time of this post). So, add it to your app:

    heroku buildpacks:add https://github.com/lookitsatravis/heroku-buildpack-phantomjs.git

  2. 3. Deploy: All that's left is deployment! Commit the Aptfile to your repo, make sure the build packs are setup, and then push to Heroku.

Hope this helps others until the final candidate is released.

Reply all
Reply to author
Forward
0 new messages