Jekyll not working in CloudFlare Pages

I was trying to use Jekyll with CloudFlare pages, but no matter what I do it doesn’t work.

Various errors I’ve got:

  1. /bin/sh: 1: jekyll: not found
  2. Could not find rexml-3.2.5 in any of the sources
  3. Could not find minima-2.5.1, jekyll-feed-0.16.0, jekyll-seo-tag-2.7.1, rexml-3.2.5 in any of the sources

My page:

It builds fine (make all) on my Ubuntu 20.04 machine.

I would recommend reading the documentation about Deploy a Jekyll site. There is described how to install Jekyll. After this is done, the error:

/bin/sh: 1: jekyll: not found

should not appear anymore.
Since we dont know what exactly your settings are it’s hard to help.

1 Like

There’s no rbenv on the cloudflare builder machines. Trying to use rbenv results in “rbenv: not found”.

As I said, I was able to get Jekyll working on my local machine. Just not on the builder machines.

I did not configure anything on the builders - just empty environment and am using a Makefile to run the build process, which calls the necessary commands.

I was attempting the following commands

cd blog && jekyll build
gem install bundler jekyll && cd blog && jekyll build
gem install bundler jekyll && cd blog && bundle exec jekyll build

I created the Gemfile/Gemfile.lock in my local machine. They are in the git repo in the OP.

Thats does not matter at all, since your local machine cant help you making it work on Cloudflare Pages.

I repeate:

Since you are not providing any info indicating how exactly your Pages Setup/Config is, it’s hard to help.

Anyway, please make sure you use the correct Build configuration and select it like:

For using Ruby commands you probably also want to include Ruby in a version you desire.

Does setting framework preset to Jekyll automagically make Jekyll show on PATH?

Apparently Jekyll will only exist when you do the “click setting framework preset to Jekyll” thing, and not otherwise. Fun magic.

And not using the Jekyll that comes from the framework preset will not work, I guess because of Ruby stuff.

You can just use this tutorial to install the version of Jekyll you want:

1 Like