Skip to content

Instantly share code, notes, and snippets.

@glennsarti
Last active October 20, 2018 01:56
Show Gist options
  • Save glennsarti/317e5a41586d753a621e2792c4f8f9df to your computer and use it in GitHub Desktop.
Save glennsarti/317e5a41586d753a621e2792c4f8f9df to your computer and use it in GitHub Desktop.
Installing Ruby for puppet windows devs on WSL on Win10
sudo apt-get install -y build-essential git libreadline-dev
sudo apt-get install -y libssl-dev zlib1g-dev
sudo apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
sudo apt-get install -y ruby1.9.1-dev zlib1g-dev
sudo apt-get install -y autoconf
sudo apt-get install -y libicu-dev
#!/bin/bash
# Assumes a clean WSL image
# Adapted from https://medium.com/@hleclerc/use-rbenv-ruby-on-windows-10-linux-wsl-a9bce8d97300#.gf9qu9bzu
# ---
sudo apt-get install -y build-essential git libreadline-dev
sudo apt-get install -y libssl-dev zlib1g-dev
sudo apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
# Upgrade git
# sudo apt-get install software-properties-common python-software-properties
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt-get update
sudo apt-get install -y git
# Extra packages
# PUPPET:
sudo apt-get install -y autoconf
# DSC:
# sudo apt-get install -y libicu-dev
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
git clone https://github.com/rkh/rbenv-whatis.git ~/.rbenv/plugins/rbenv-whatis
git clone https://github.com/rkh/rbenv-use.git ~/.rbenv/plugins/rbenv-use
cd ~/.rbenv && src/configure && make -C src
echo 'export PATH=$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
eval "$(rbenv init -)"
rbenv install 2.3.1
rbenv install 1.9.3-p551
rbenv rehash
rbenv global 1.9.3-p551
rbenv use 1.9.3-p551
gem install bundler
rbenv global 2.3.1
rbenv use 2.3.1
gem install bundler

Add an exception for Windows Defender for %LOCALAPPDATA%\lxss to speed things up

Note-

On first bundle you may receive an error

ArgumentError: parent directory is world writable but not sticky

From: rubygems/bundler#4599 (comment)

find ~/.bundle/cache -type d -exec chmod 0755 {} +
@ferventcoder
Copy link

Nice....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment