Building GitHub pages locally using Nix

Viewed 564

I'm on NixOS and I want to build locally some GitHub pages.

GitHub seems to indicate that I should create a Gemfile containing:

gem "github-pages", group: :jekyll_plugins

Following the Nixpkgs manual section on Ruby, I did:

$ cat > Gemfile
source 'https://rubygems.org'
gem "github-pages", group: :jekyll_plugins
$ $(nix-build '<nixpkgs>' -A bundix --no-out-link)/bin/bundix --magic

which resulted in a build failure on Nokogiri:

An error occurred while installing nokogiri (1.8.1), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.8.1'` succeeds before bundling.

The build failure is the following:

zlib is missing; necessary for building libxml2

I've confirmed that the issue is when building Nokogiri by running:

gem install nokogiri -v '1.8.1'

in various environments (with nix-shell -p zlib, nix-shell -p zlibStatic, nix-shell -p zlib libxml2, nix-shell -p zlib pkgconfig, etc).

From searching on Google, it seems that Nokogiri is a very common dependency (e.g. Rails depends on it), so I guess most people have overcome the difficulty I'm confronted to. What am I missing?

1 Answers
Related