Search code examples
rubyherokuphantomjsbuildpack

Heroku error: "Could not find an executable ["phantomjs"] on your path."


I get an error when I run ruby bin/test.rb in the heroku console

Error

"Could not find an executable ["phantomjs"] on your path."

I have two files: bin/test.rb and Gemfile

Gemfile

source 'https://rubygems.org'

gem 'capybara'
gem 'poltergeist'
gem 'mail'
gem 'rmagick'

I ran

 heroku config:add BUILDPACK_URL=https://github.com/stomita/heroku-buildpack-phantomjs.git

I ran

 heroku config:set PATH="/usr/local/bin:/usr/bin:/bin:/app/vendor/phantomjs/bin" 

I'm not sure of the path for phantonJS or where the build pack puts it.
How to I fix this error?


Solution

  • I had to do a recommit on Heroku to get it working. Bundle install and restart was not enough.