UPDATE: Troubleshooting added to the bottom of the page
Don’t Be BASHful
Or is that Be BASHful? I’m not sure. That joke got away from me already.
First order of business:
- Enable “Bash on Ubuntu on Windows”
That’s right. CLICeption. Managing a Jekyll static site on Windows just got a whole lot easier! This is a fast track setup (no pictures). Assumes you know at least a little about what you’re doing.
Windows Dev Mode
First, enable Windows Dev Mode. Run this in an Elevated PowerShell window:
Now run the App Wizard. Type this in PowerShell:
Or just Start–> Run –> appwiz.cpl
- Select Turn Windows features on or off (Left Sidebar)
- Scroll down and check the box labeled “Windows Subsystem for Linux Beta”
- Allow your computer to Restart
Upon restart you want to run bash.exe, either from PowerShell or you can hit the Windows key and type “bash.exe”
You will get a terms of service window saying this is a Beta Feature. Type ‘y’ to continue. Don’t back out on me now!
Follow the instructions to create a user account and password. DO NOT use lxrun /install /y. DO NOT use root as your user. JUST DON’T DO IT! Use Sudo.. same as any sane person would on a straight Linux distro.
Now you should have a fully functional “Bash on Ubuntu on Windows” application. Woot!
A Little System Prep
This will update all of your packages, then install git, along with some other tools.
Install Ruby 2.3.1
The system may ask for your password multiple times when RVM wants to start installing packages
Prerequisites:
GPG Key:
Use curl to get pull down RVM
Load RVM on login with .bashrc
Re-source .bashrc
Install Ruby via RVM
Tell RVM to use 2.3.1 by default. Use ruby -v to verify.
After that is done you can install Bundler
And finally:
Install Jekyll
Note: Please keep case in mind with the gem commands. gem install Jekyll -ne gem install jekyll
And that’s it! You’re officially running Jekyll on Ruby on Bash on Ubuntu on Windows.
Bet you never thought THIS day would come! Welcome to the new Microsoft. And I think the party is just getting started.
Note: The RVM section comes from this document: Rails Setup Doc. Visit it for more helpful hints; like how to set up SSH access to GitHub via certificate.
Troubleshooting
Issues:
- ArgumentError: parent directory is world writable but not sticky:
- After installing Ruby via RVM and then Bundler, you may get an error when running
bundle install
- To resolve the issue, run this from the BASH prompt:
find ~/.bundle/cache -type d -exec chmod 0755 {} +
- After installing Ruby via RVM and then Bundler, you may get an error when running
- jekyll 3.0.1 Error: Invalid argument - Failed to watch
- You will get this if you try to run
jekyll serve
by itself. This is due to the fact that filesystem watchers and inotify support are currently not implemented (but they are on their way!). Check: https://github.com/Microsoft/BashOnWindows/issues/216 for more info. - To resolve this issue run
jekyll serve -w --force_polling
Please note the underscore.
- You will get this if you try to run
Till next time!