Skip to content

Instantly share code, notes, and snippets.

@Convincible
Last active June 18, 2018 11:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Convincible/29e1f1f26556a1f2089b4fe38af2cc22 to your computer and use it in GitHub Desktop.
Save Convincible/29e1f1f26556a1f2089b4fe38af2cc22 to your computer and use it in GitHub Desktop.
Commands to run to set up WSL for website development with Jekyll and DatoCMS running on Netlify
#!/bin/bash
# This set of commands to be run after fresh install Ubuntu on Windows
# It is not intended as an actual script to run by itself
# Update OS
sudo apt update
sudo apt upgrade
# NVM (Node Version Manager)
touch ~/.bashrc
# Follow instructions at: https://github.com/creationix/nvm#install-script
# RESTART BASH HERE
# NODE.JS
nvm install --lts # Install latest version of Node.js
npm install -g npm # Update NPM (Node Package Manager) to latest version
# RBENV (Simple Ruby Version Management)
# Dependencies
sudo apt-get install -y autoconf bison build-essential libssl-dev libyaml-dev libreadline-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev
# Install
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
# Add plugin to build Ruby
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
# Dynamic compilation
sudo apt-get install -y gcc
sudo apt install -y make
cd ~/.rbenv && src/configure && make -C src
# RESTART BASH HERE
# RUBY
# Check rbenv working: curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
# Install Ruby
rbenv install 2.4.3 # Latest supported by Netlify
rbenv global 2.4.3
# Check Ruby working: ruby -v
gem install bundler
# SYMLINK TO WORKING DIRECTORY
ln -s /mnt/c/.../webdev webdev
cd ~/webdev
# JEKYLL
sudo apt install -y g++
gem install jekyll
# WEB APP
bundle install
npm install
npm audit fix
npm prune
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment