Building Jekyll

Hello there! First post!

I’m trying to setup Jekyll on my NixOS server with this repo:

I’m having issues installing the Gems, here is the build so far:

I think you’re probably more likely to get a useful response if you go into a bit more detail about what you’re doing precisely and what issues you’re running into.

@robx

That’s fair and sorry for leaving that out. I’m trying to find out if I need to add ruby and zlib or can I just have jekyll and maybe zlib to my configuration for this to build. I have looked this up a bit and found blog posts like this though this one is from 2019 so a lot might have changed.

If I have them all and try to run this:

gem install jekyll bundler

I get this:

But with gem install github-pages I get this:

Perhaps rubyPackages.github-pages is what you want?

nix-shell --pure --packages rubyPackages.github-pages
jekyll --serve

That’s interesting and might work, I think one issue is that I’m trying to get this off Github pages so it would just be a normal Jekyll site but I didn’t know about the --pure option!

It looks like I’m still missing it?:

/nix/store/cf2fghb8vxxwmniv8cl6cvsyzabjrvl3-ruby-2.7.6/lib/ruby/2.7.0/bundler/resolver.rb:290:in `block in verify_gemfile_dependencies_are_found!': Could not find gem ‘github-pages’ in any of the gem sources listed in your Gemfile. (Bundler::GemNotFound)

That was just to get a clean environment, to maximize the chance of reproducibility on your machine.

Then perhaps just use the jekyll package? MWE:

cd $(mktemp -d)
nix-shell --pure --packages jekyll
echo 'Hello you!' > hello.txt
jekyll serve

Then http://localhost:4000/hello.txt should show a greeting.

I know very little about ruby packaging but if you want more than jekyll then perhaps something like this works:

cd $(mktemp -d)
nix-shell --pure --packages 'ruby.withPackages (ps: [ps.jekyll ps.jekyll-paginate])'
echo 'Hello you!' > hello.txt
jekyll serve

Are you trying to use bundler? I believe you should be able to avoid that and Gemfile et cetera, by specifying the packages you want using rubyWithpackages as above, but I have not tested this, since my only experience with ruby is developing GitHub Pages sites.

It looks like it is about the plugins:

I can’t get the jekyll-feed and jekyll-redirect-from plugins to work, I have the rubyPackages but still no go.

I got it!

nix-shell -p jekyll rubyPackages.webrick rubyPackages.jekyll-feed rubyPackages.jekyll-redirect-from

Now all the pages work!