Installing Jekyll on windows.
I installed this based on the excellent guide on setting this up on Jekyll’s site here. https://jekyllrb.com/docs/windows/
This is a overview of the commands that I run.
- Update system
sudo apt-get update -y && sudo apt-get upgrade -y Hit:1 http://security.ubuntu.com/ubuntu xenial-security InRelease Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease Hit:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease Hit:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease Reading package lists... Done Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following package was automatically installed and is no longer required: libfreetype6 Use 'sudo apt autoremove' to remove it. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. andrew@DESKTOP-SNCN8DQ:~$ sudo apt autoremove Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: libfreetype6 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 928 kB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 25530 files and directories currently installed.) Removing libfreetype6:amd64 (2.6.1-0.1ubuntu2.3) ... Processing triggers for libc-bin (2.23-0ubuntu9) ...
- Add repositories
- Running this in one copy past does not work
andrew@DESKTOP-SNCN8DQ:~$ sudo apt-add-repository ppa:brightbox/ruby-ng Next generation Ubuntu packages for Ruby 2.4,2.3, 2.2, 2.1, 2.0 1.9.3 and 1.8 EE. See https://www.brightbox.com/docs/ruby/ubuntu/ for more details. This PPA no longer includes Phusion Passenger packages, and NGINX packages with Passenger support. See https://launchpad.net/~brightbox/+archive/ubuntu/passenger-legacy Discussion list here: https://groups.google.com/forum/#!forum/brightbox-ruby-ubuntu-packaging https://www.brightbox.com More info: https://launchpad.net/~brightbox/+archive/ubuntu/ruby-ng Press [ENTER] to continue or ctrl-c to cancel adding it gpg: keyring `/tmp/tmpty8y8tl8/secring.gpg' created gpg: keyring `/tmp/tmpty8y8tl8/pubring.gpg' created gpg: requesting key C3173AA6 from hkp server keyserver.ubuntu.com gpg: /tmp/tmpty8y8tl8/trustdb.gpg: trustdb created gpg: key C3173AA6: public key "Launchpad PPA for Brightbox" imported gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1) OK
- Update again for this new repository and install ruby.
sudo apt-get update sudo apt-get install ruby2.3 ruby2.3-dev build-essential
- Update Gem
sudo gem update
- Install Jekyll using Gem (trimed up the output)
andrew@DESKTOP-SNCN8DQ:~$ sudo gem install jekyll bundler Fetching: public_suffix-3.0.1.gem (100%) Successfully installed public_suffix-3.0.1 Fetching: addressable-2.5.2.gem (100%)
- Success well that was easy !!
andrew@DESKTOP-SNCN8DQ:~$ jekyll -v jekyll 3.6.2
- Well close anyway I needed to also install minima and jekyll-feed
andrew@DESKTOP-SNCN8DQ:~$ jekyll s -s /mnt/c/Users/MyUser/Documents/www/ Configuration file: /mnt/c/Users/MyUser/Documents/www/_config.yml jekyll 3.6.2 | Error: The minima theme could not be found. andrew@DESKTOP-SNCN8DQ:~$ jekyll s -s /mnt/c/Users/MyUser/Documents/www/ Configuration file: /mnt/c/Users/MyUser/Documents/www/_config.yml Dependency Error: Yikes! It looks like you don't have jekyll-feed or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- jekyll-feed' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/! jekyll 3.6.2 | Error: jekyll-feed andrew@DESKTOP-SNCN8DQ:~$ sudo gem install jekyll-feed Fetching: jekyll-feed-0.9.2.gem (100%) Successfully installed jekyll-feed-0.9.2 Parsing documentation for jekyll-feed-0.9.2 Installing ri documentation for jekyll-feed-0.9.2 Done installing documentation for jekyll-feed after 0 seconds 1 gem installed
This is where Bash on windows gets a bit interesting. You linux VM has its own separate file system and mounts your c drive under /mnt. If you try to change your working directory to your C drive is located Jekyll will not run.
andrew@DESKTOP-SNCN8DQ:/mnt/c/Users/MyUser/Documents/www$ jekyll s /var/lib/gems/2.3.0/gems/bundler-1.16.0/lib/bundler/spec_set.rb:88:in `block in materialize': Could not find public_suffix-2.0.5 in any of the sources (Bundler::GemNotFound) from /var/lib/gems/2.3.0/gems/bundler-1.16.0/lib/bundler/spec_set.rb:82:in `map!' from /var/lib/gems/2.3.0/gems/bundler-1.16.0/lib/bundler/spec_set.rb:82:in `materialize' from /var/lib/gems/2.3.0/gems/bundler-1.16.0/lib/bundler/definition.rb:170:in `specs' from /var/lib/gems/2.3.0/gems/bundler-1.16.0/lib/bundler/definition.rb:237:in `specs_for' from /var/lib/gems/2.3.0/gems/bundler-1.16.0/lib/bundler/definition.rb:226:in `requested_specs' from /var/lib/gems/2.3.0/gems/bundler-1.16.0/lib/bundler/runtime.rb:108:in `block in definition_method' from /var/lib/gems/2.3.0/gems/bundler-1.16.0/lib/bundler/runtime.rb:20:in `setup' from /var/lib/gems/2.3.0/gems/bundler-1.16.0/lib/bundler.rb:107:in `setup' from /var/lib/gems/2.3.0/gems/jekyll-3.6.2/lib/jekyll/plugin_manager.rb:50:in `require_from_bundler' from /var/lib/gems/2.3.0/gems/jekyll-3.6.2/exe/jekyll:11:in `<top (required)>' from /usr/local/bin/jekyll:23:in `load' from /usr/local/bin/jekyll:23:in `<main>' andrew@DESKTOP-SNCN8DQ:/mnt/c/Users/MyUser/Documents/www$
So you will need to stay in the linux file system and tell jekyll where to find the files (assuming you are storing them on the c drive)
andrew@DESKTOP-SNCN8DQ:~$ jekyll s -s /mnt/c/Users/MyUser/Documents/www/ Configuration file: /mnt/c/Users/MyUser/Documents/www/_config.yml Source: /mnt/c/Users/MyUser/Documents/www/ Destination: /home/andrew/_site Incremental build: disabled. Enable with --incremental Generating... done in 2.306 seconds. Auto-regeneration may not work on some Windows versions. Please see: https://github.com/Microsoft/BashOnWindows/issues/216 If it does not work, please upgrade Bash on Windows or run Jekyll with --no-watch. Auto-regeneration: enabled for '/mnt/c/Users/MyUser/Documents/www/' Server address: http://127.0.0.1:4000/ Server running... press ctrl-c to stop.