Fixing ImageMagick convert not found error in Cloudflare Pages [Jekyll Build]
Recently I migrated my personal webpage from Firebase hosting to Cloudflare Pages and the jekyll build
process was failing. A quick inspection of the logs suggested ImageMagick convert
was not found in the build environment. Cloudflare useses Ubuntu 22.04.2 for the build process and asdf
package manager.
To resolve the issue I set the UNSTABLE_PRE_BUILD
environment variable as following,
asdf plugin add imagemagick && asdf install imagemagick 7.1.1-29 && asdf global imagemagick 7.1.1-29
Another issue leading to build failure was related to a text encoding problem in jekyll-scholar
extenstion. The easiest solution is to specify UTF-8
encoding in build environment variables.
LANG = C.UTF-8
LANGUAGE = C.UTF-8
LC_ALL = C.UTF-8
Comparatively the Cloudflare Pages response time is slightly slower than Firebase, but now the static site generation part is taken care by Cloudflare and their free plan is more generous and offer additional features.
Enjoy Reading This Article?
Here are some more articles you might like to read next: