Last active
June 21, 2023 07:03
-
-
Save havenwood/6233659 to your computer and use it in GitHub Desktop.
Install the latest stable Ruby as a local user (non-root).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# A non-root installation of the latest Ruby with chruby | |
# Install chruby (https://github.com/postmodern/chruby#readme) | |
mkdir -p $HOME/src | |
cd $HOME/src | |
wget -O chruby-0.3.9.tar.gz https://github.com/postmodern/chruby/archive/v0.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/chruby.sh" >> ~/.bashrc | |
echo "source ~/.chruby/share/chruby/auto.sh" >> ~/.bashrc | |
# Then set whatever Ruby version you want as default | |
echo "ruby-2.3" > ~/.ruby-version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install ruby-install (https://github.com/postmodern/ruby-install#readme) | |
mkdir -p $HOME/src | |
cd $HOME/src | |
wget -O ruby-install-0.6.0.tar.gz https://github.com/postmodern/ruby-install/archive/v0.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