Skip to content

Instantly share code, notes, and snippets.

@seccomiro
Last active April 17, 2020 16:33
Show Gist options
  • Save seccomiro/1f6089a3dff09503cad3d6e8774d4b00 to your computer and use it in GitHub Desktop.
Save seccomiro/1f6089a3dff09503cad3d6e8774d4b00 to your computer and use it in GitHub Desktop.
Install rbenv, ruby-build, rbenv-vars and Ruby 2.7.1 on Ubuntu
#!/bin/sh
# Just run:
# sh -c "$(wget -O- https://gist.githubusercontent.com/seccomiro/1f6089a3dff09503cad3d6e8774d4b00/raw/fc8965c22237d527b29f95d05cabcf673ab2851d/ruby-2.7.1.sh)"
{ # this ensures the entire script is downloaded #
sudo apt install git build-essential libssl-dev zlib1g-dev
cd ~/.rbenv && src/configure && make -C src
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
cd ~/.rbenv && src/configure && make -C src
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
~/.rbenv/bin/rbenv init
mkdir -p "$(rbenv root)"/plugins
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
git clone https://github.com/rbenv/rbenv-vars.git $(rbenv root)/plugins/rbenv-vars
rbenv install 2.7.1
rbenv global 2.7.1
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
} # this ensures the entire script is downloaded #
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment