I'm trying to get the image_optim gem to work with a Rails 4 app on Heroku's Cedar stack to optimize png/gif/jpeg images.
I threw the required binaries (advpng
, gifsicle
, jpegoptim
, jpegtran
, optipng
, pngcrush
, pngout
) into /bin
and set ENV['PATH'] = "#{Rails.root}/bin:#{ENV['PATH']}"
in an initializer. This works for gifs and pngs, but I'm running into problems with jpegs.
In the rails console I get:
irb(main):001:0> `jpegoptim`
jpegoptim: error while loading shared libraries: libjpeg.so.8: cannot open shared object file: No such file or directory
How should I go about installing libjpeg
on Heroku?