Studiosity / grover

A Ruby gem to transform HTML into PDFs, PNGs or JPEGs using Google Puppeteer/Chromium
MIT License
946 stars 107 forks source link

access to chrome version not in synch with installed version #224

Closed dvodvo closed 9 months ago

dvodvo commented 9 months ago

Grover::JavaScript::Error (Could not find Chrome (ver. 119.0.6045.105) the ubuntu user's home directory `/home/deploy/.cache/puppeteer/chrome lists a different chrome version linux-121.0.6167.85 pointing to the second resolution path suggested.

The first line of debugging was enacted npx puppeteer browsers install chrome from withtin the application and yes a directory /home/deploy/.cache/puppeteer/chrome/linux-119.0.6045.105 was created. Also created was a directory ~/.cache/puppeteer/chrome-headless-shell.

But then a new error emerges:

Grover::JavaScript::Error (Failed to launch the browser process!
/home/deploy/.cache/puppeteer/chrome/linux-119.0.6045.105/chrome-linux64/chrome: error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory

even though a 230 MB chrome file exists at the above directory location

~/.cache/puppeteer/chrome/linux-119.0.6045.105/chrome-linux64$ ls -al
total 267556
[...]
-rwxr-xr-x 1 deploy deploy 230879456 Feb 10 12:36 chrome error: while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory

Given the versions it appears the installed version is more recent.
I assume that grover requires some additional configuration to properly synch up, but I fail to find that information.

abrom commented 9 months ago

This sounds like a puppeteer install issue. I think you're best looking at the puppeteer documentation

https://github.com/puppeteer/puppeteer and https://pptr.dev/troubleshooting

dvodvo commented 9 months ago

It turns out the final error message from the edit was pointing in the right direction. sudo apt install libasound2 installed the missing library (the motive for its being missing is a head scratcher) and allowed grover to run as expected.

note this was actually devised via this page when searching for the library element