Skip to content

Instantly share code, notes, and snippets.

@fpauser
Forked from jnx/rbenv-install-system-wide.sh
Last active December 30, 2020 21:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fpauser/6366862 to your computer and use it in GitHub Desktop.
Save fpauser/6366862 to your computer and use it in GitHub Desktop.
rbenv single & system-wide installation for Debian (tested with Debian 7.1) & Ubuntu (tested with Ubuntu 12.04 LTS)
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone https://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
echo '# rbenv setup' > /etc/profile.d/rbenv.sh
echo 'export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.sh
echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/rbenv.sh
echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh
chmod +x /etc/profile.d/rbenv.sh
source /etc/profile.d/rbenv.sh
# Install ruby-build:
pushd /tmp
git clone https://github.com/sstephenson/ruby-build.git
cd ruby-build
./install.sh
popd
# Comments
echo "To install Ruby 2.0.0-p195 run:"
echo "sudo -i rbenv install 2.0.0-p195"
echo "To make Ruby 2.0.0-p195 the global default ruby run:"
echo "sudo -i rbenv global 2.0.0-p195"
echo "For rehashing run:"
echo "sudo -i rbenv rehash"
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv:
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
# Add rbenv to the path:
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile
echo 'eval "$(rbenv init -)"' >> ~/.profile
source ~/.profile
# Install ruby-build:
pushd /tmp
git clone https://github.com/sstephenson/ruby-build.git
cd ruby-build
./install.sh
popd
# Comments
echo "To install Ruby 2.0.0-p195 run:"
echo "rbenv install 2.0.0-p195"
echo "To make Ruby 2.0.0-p195 the global default ruby run:"
echo "rbenv global 2.0.0-p195"
echo "For rehashing run:"
echo "rbenv rehash"
@iguojun
Copy link

iguojun commented May 25, 2020

Thanks!

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