Skip to content

Instantly share code, notes, and snippets.

@rpfilomeno
Last active December 16, 2021 18:28
Show Gist options
  • Save rpfilomeno/d1e641d0fdf94eb91b54aef5df40401b to your computer and use it in GitHub Desktop.
Save rpfilomeno/d1e641d0fdf94eb91b54aef5df40401b to your computer and use it in GitHub Desktop.
WSL2 Ruby Installation

Installation of required libraries

sudo apt-get update sudo apt-get upgrade -y sudo apt-get install -y autoconf bison build-essential libssl-dev libyaml-dev libreadline-dev zlib1g zlib1g-dev imagemagick git sudo apt-get install -y nodejs npm sudo apt-get install -y sqlite3 libsqlite3-dev sudo apt-get install -y libmariadb-dev sudo apt-get install -y libmysqlclient-dev

Yarn installation

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt-get update sudo apt-get install yarn -y

Install Ruby

git clone https://github.com/sstephenson/rbenv.git ~/.rbenv

echo '[ -f "$HOME/.profile" ] && source "$HOME/.profile"' >> ~/.bash_profile

echo '[ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc"' >> ~/.bash_profile

echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile

source ~/.bash_profile

~/.rbenv/bin/rbenv init

echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

source ~/.bash_profile

Verification

rbenv -v

Install ruby-build

mkdir -p "$(rbenv root)"/plugins

git clone https://github.com/sstephenson/ruby-build.git "$(rbenv root)"/plugins/ruby-build

Install ruby

rbenv install -l

rbenv install 2.6.6

Confirmation of installed ruby

rbenv global 2.6.6

ruby -v

Install bundle

gem install bundle

sudo gem install jekyll jekyll-feed jekyll-gist jekyll-paginate jekyll-sass-converter jekyll-coffeescript

bundle update

gem uninstall psych

gem install activesupport -v '6.0.4.1' --source 'https://rubygems.org/'

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