Installing Jekyll on Arch / Manjaro systems
Ensure ruby prerequisites are installed with a full system upgrade for safety:
sudo pacman -Syu ruby base-develAdd ruby gems to your PATH by appending it to a file named .profile in your home directory:
echo 'PATH="$PATH:$(ruby -e 'puts Gem.user_dir')/bin"'Source your new profile file and restart bash. Alternatively, you can log out and back in again:
source .profile
exec $SHELLTo view the current gem environment:
gem envInstall jekyll and bundler:
gem install jekyll bundlerIf you get errors about ruby gems not being in your path, you need to ensure you did the steps above correctly. Look for reasons why it did not add to your PATH; the Arch Wiki is a great resource.
Verify the gems installed by listing gems, where you should see both jekyll and bundler:
gem listNow try to invoke jekyll by navigating to an existing jekyll site folder and typing:
bundle exec jekyll buildor if you don’t have a jekyll site already, then try building a new one.
If you get an error about a missing gem, you can use bundler to go get prerequisites. I don’t really know how bundler works to be honest; when I first started using jekyll it was a simple jekyll build use case. This whole bundle thing reminds me of nodejs and npm, but I’m told it sorts out gem versioning so that packages work – so there we have it!
If the missing gem is public_suffix you can get it by:
gem install public_suffixand if it still doesn’t work, then:
bundle installLet that run its course and once all prerequisites are installed, jekyll is now in your path and all necessary gems would be installed.
Et voilà ! You should be able to build a jekyll site.
Addendum
2020-07-23
I forgot to include that .profile is not sourced by bash by default, so everytime you login, you’d have to source it before using gems. That’s nonsense, so duly add it to .bashrc instead or source .profile from within .bashrc instead.