DEV Community

Erkhembayar Gantulga
Erkhembayar Gantulga

Posted on • Updated on

Deploy Jekyll to DO App Platform

Personal blog

Category Submission: Personal Site/Portfolio

App Link

https://blog-vaina.ondigitalocean.app/

Screenshots

Blog homepage
Blog post detail

Description

I was created my personal blog using Jekyll.

Link to Source Code

https://github.com/erheme318/blog

Permissive License

MIT

Background

(What made you decide to build this particular app? What inspired you?)

In 2021, I would like to improve my writing skill. The reason was that i've read that writing can improve clear thinking skills. So, i've put it one of my resolutions of 2021. That's why, i started my personal blog.

How I built it

(How did you utilize DigitalOcean’s App Platform? Did you learn something new along the way? Pick up a new skill?)

I've never used Jekyll before. After comparing several blogging platforms and tools, i decided to use Jekyll because of simplicity.

Problems & Solutions

I've encountered with the following error on my first deployment:

Running custom build command: bundle exec jekyll build -d ./public
blog | 00:17:09 bundler: failed to load command: jekyll (/layers/heroku_ruby/gems/vendor/bundle/ruby/2.6.0/bin/jekyll)
blog | 00:17:09 Gem::Exception: can't find executable jekyll for gem jekyll. jekyll is not currently included in the bundle, perhaps you meant to add it to your Gemfile?
Enter fullscreen mode Exit fullscreen mode

First I installed Jekyll on my machine (dev environment), it was working. But when I deploy to DO App Platform. It failed. So, I've tried to find out the cause.

  1. I've changed Build Command (added bundle install, bundle update commands and removed bundle exec from bundle exec jekyll build -d ./public) because i thought it might be the ruby instance issue. But it wasn't the case
  2. I've tried DO's Jekyll sample code to deploy: https://github.com/digitalocean/sample-jekyll. It was working. Jekyll's version was 4.0.0, but mine was 4.2.0 (latest version)
  3. Then I've downgraded jekyll and replaced Gemfile.lock with DO's Jekyll sample code. It works!
  4. Finally, I've compared the code diff and I've figured out that the reason was the platforms configuration on Gemfile.lock. My Gemfile.lock was configured as Platforms: x86_64-linux but DO's Jekyll sample was configured as Platforms: ruby. Therefore, I added platform ruby using bundle lock --add-platform ruby in order to fix it. You can see the fix commit here
  5. I re-deployed the blog with latest Jekyll version. It works!

Top comments (1)

Collapse
 
yura_voevodin profile image
Yura Voevodin

I had the same issue, thank you!