ruby-gnome: Unable to install poppler on Heroku
I’ve been trying to get poppler to work on Heroku for a couple of days now with no success. Here are the things I’ve tried:
- Use
https://github.com/heroku/heroku-buildpack-activestorage-previewbuildpack which includespopplerfor Rails 5.2. This failsgobject-introspection 3.3.0install with the following error:
remote: checking for gobject-introspection-1.0... no
remote: installing 'libgirepository1.0-dev' native package... require super user
remote: privilege
remote: 'libgirepository1.0-dev' native package is required.
remote: Run the following command as super user to install required native package:
remote: # apt install -V -y libgirepository1.0-dev
- Use
https://github.com/iwasaki-d/heroku-buildpack-ruby-popplerbuildpack, which builds version 0.59.0. Also triedhttps://github.com/Captive-Studio/heroku-buildpack-ruby-popplerwhich builds version 0.69.0. Onheroku-18stack, they fail with:
remote: Makefile:1696: recipe for target 'stage1scan.c' failed
remote: make[2]: *** [stage1scan.c] Segmentation fault
remote: make[2]: Leaving directory '/app/tmp/buildpacks/da268f3348644ae2c7bfbcddcbb4aaccb8f5982dab5dc1c6bd70c93922e568a6fa585adc1914eb5213c3c2394864ac20722e8909fde8fe19b958d89456c001b4/tmp/flex-2.6.4/src'
remote: Makefile:546: recipe for target 'all' failed
remote: make[1]: *** [all] Error 2
remote: make[1]: Leaving directory '/app/tmp/buildpacks/da268f3348644ae2c7bfbcddcbb4aaccb8f5982dab5dc1c6bd70c93922e568a6fa585adc1914eb5213c3c2394864ac20722e8909fde8fe19b958d89456c001b4/tmp/flex-2.6.4/src'
remote: Makefile:533: recipe for target 'all-recursive' failed
This seems to be more of an issue with flex and heroku-18. I tried again on heroku-16 stack and finally got a successful build, but it fails when detecting Rake tasks with the following error:
GObjectIntrospection::RepositoryError::TypelibNotFound: Typelib file for namespace 'Poppler' (any version) not found
I tried to fix that by setting GI_TYPELIB_PATH=/app/.apt/usr/lib/x86_64-linux-gnu/girepository-1.0 but that didn’t help.
- Use
heroku-community/aptbuildpack with the following libraries:
libgirepository-1.0-1
libgirepository1.0-dev
libpoppler-glib-dev
This failed with the same Poppler typelib error above. GI_TYPELIB_PATH did not help.
I also tried poppler 3.1.9 but got this error:
LoadError: cannot load such file -- cairo-gobject
I’m at a total loss…how do I get Poppler working on Heroku? These tests are all with a brand new Rails app and new Heroku app. My guess is that I’m closest to success when I’m getting the typelib error, but I’m not sure how to fix that.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 54 (25 by maintainers)
Commits related to this issue
- Add support for GObject Introspection - Add `.apt/usr/lib` to `LD_LIBRARY_PATH` and `LIBRARY_PATH` to use the zlib installed by apt. It's required because `libpng16.s0` needs the zlib 1.2.9 or la... — committed to nickrivadeneira/heroku-buildpack-apt by nickrivadeneira 8 years ago
- Add support for GObject Introspection - Add `.apt/usr/lib` to `LD_LIBRARY_PATH` and `LIBRARY_PATH` to use the zlib installed by apt. It's required because `libpng16.s0` needs the zlib 1.2.9 or la... — committed to nickrivadeneira/heroku-buildpack-apt by nickrivadeneira 8 years ago
- Add support for GObject Introspection - Add `GI_TYPELIB_PATH` to search `.typelib` files. - This required a stack upgrade to `heroku-18` due to a dependency on zlib > 1.2.9. Context: https://githu... — committed to nickrivadeneira/heroku-buildpack-apt by nickrivadeneira 8 years ago
- Add support for GObject Introspection Add `GI_TYPELIB_PATH` to search `.typelib` files. Context: https://github.com/ruby-gnome2/ruby-gnome2/issues/1257#issuecomment-451049702 — committed to nickrivadeneira/heroku-buildpack-apt by nickrivadeneira 8 years ago
- Add support for GObject Introspection Add to search files. Context: ruby-gnome/ruby-gnome#1257 (comment) — committed to kmeyerhofer/heroku-buildpack-apt by kmeyerhofer 5 years ago
If anyone is facing the same issue, here’s what worked for me
(Heroku stack 20):Removed
popplerfromGemfileAptfile:Heroku buildpacksthanks for sharing the update @michaelschmitz I have the poppler gem too, hmmm gonna need a little more time to find out the cause here… will share if any
Good to know. 😃
@kou You solved it. It works now - many thanks!
In case other people have the same issue and want to use Poppler on the Heroku-18 stack, this is my current setup:
Heroku buildpacks:
Gemfile (Edit: added after @shanqyeet’s message below for completeness):
boot.rb:
Aptfile:
Could you also add
gir1.2-glib-2.0to yourAptfile?An empty
GObjectIntrospection::Repository.search_pathis no problem because it’s initialized lazy. It’s not initialized withoutprepend_search_path,GObjectIntrospection.loadand so on.Thanks.
GObjectIntrospection::Repository.prepend_search_path('/app/.apt/usr/lib/x86_64-linux-gnu/girepository-1.0')gir1.2-freedesktoptoAptfile.gem "poppler"toGemfileand removegem "gobject-introspection"fromGemfileandGObjectIntrospection.load("Poppler")fromboot.rb.Could you add
Find.find("/app") {|path| puts(path)}to yourboot.rb?Could you try the following?
Thanks. Can you use
kou@cozmixng.orgas my Heroku account?