Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Install the latest stable Ruby as a local user (non-root).
# A non-root installation of the latest Ruby with chruby
# Install chruby (
mkdir -p $HOME/src
cd $HOME/src
wget -O chruby-0.3.9.tar.gz
tar -xzvf chruby-0.3.9.tar.gz
cd chruby-0.3.9/
PREFIX=$HOME/.chruby make install
# Add the source lines to your ~/.bashrc or ~/.zshrc
echo "source ~/.chruby/share/chruby/" >> ~/.bashrc
echo "source ~/.chruby/share/chruby/" >> ~/.bashrc
# Then set whatever Ruby version you want as default
echo "ruby-2.3" > ~/.ruby-version
# Install ruby-install (
mkdir -p $HOME/src
cd $HOME/src
wget -O ruby-install-0.6.0.tar.gz
tar -xzvf ruby-install-0.6.0.tar.gz
cd ruby-install-0.6.0/
PREFIX=$HOME/.ruby-install make install
# Install latest stable Ruby
$HOME/.ruby-install/bin/ruby-install --latest --no-install-deps ruby
# Now restart your terminal so chruby can detect your shiny new Ruby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment