HerokuCaleb HearthTutorial
Jekyll on Heroku
Summary
Jekyll can be deployed on Heroku to use its plugin system, but relying on jekyll serve would use Ruby’s single-threaded WEBrick rather than a production-oriented web server. The setup installs Ruby with ruby-install and chruby, then installs Bundler and Jekyll, creates a site, and tracks it in Git. Heroku’s official Ruby buildpack handles dependencies and runs a Rake assets:precompile task that executes jekyll build, while the Static buildpack serves the generated _site/ directory according to static.json. The example pins Ruby 2.4.2, adds Rake, enables clean URLs and HTTPS, and completes with a successful deployment of the generated site to a Heroku URL.
Context
The setup is motivated by running Jekyll on Heroku while retaining Jekyll’s plugin system, instead of relying on jekyll serve and its Ruby built-in, single-threaded WEBrick server for a public site.
Approach / What changed
Use the Ruby and Static Heroku buildpacks together. The Ruby buildpack installs the Gemfile dependencies and runs a Rake assets:precompile task that executes jekyll build; the Static buildpack serves the resulting _site/ directory, configured through static.json.
Takeaways
static.json sets clean_urls and https_only to true and uses _site/ as the serving root.
The Rakefile defines assets:precompile to execute jekyll build, allowing Heroku’s Ruby buildpack to generate the complete static site during deployment.
The example pins Ruby to 2.4.2, adds Rake to the Gemfile, and finishes with a successful Heroku deployment using both buildpacks.
Source and freshness
- Source
- heroku.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.