Skip to content

Instantly share code, notes, and snippets.

@ZPVIP
Forked from jnx/rbenv-install-system-wide.sh
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save ZPVIP/890067d7ddfa3b3ac5e7 to your computer and use it in GitHub Desktop.

Select an option

Save ZPVIP/890067d7ddfa3b3ac5e7 to your computer and use it in GitHub Desktop.
# Update, upgrade and install development tools:
apt-get update
#apt-get -y upgrade
apt-get -y install git-core autoconf bison build-essential libssl-dev libyaml-dev libreadline6 libreadline6-dev zlib1g zlib1g-dev
PREFIX="/usr/local"
RBENV_PREFIX="$PREFIX/rbenv"
BIN_PATH="$PREFIX/bin"
RBENV_GROUP="rbenv"
umask 002
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
cat <<EOF > /etc/profile.d/rbenv.sh
# rbenv setup
export RBENV_ROOT=${RBENV_PREFIX}
export PATH=${RBENV_ROOT}/bin:${PATH}
eval "\$(rbenv init -)"
EOF
chmod +x /etc/profile.d/rbenv.sh
source /etc/profile.d/rbenv.sh
# Install ruby-build:
pushd /tmp
git clone git://github.com/sstephenson/ruby-build.git
cd ruby-build
./install.sh
popd
mkdir $RBENV_PREFIX/plugins
git clone git://github.com/sstephenson/rbenv-gem-rehash.git ${RBENV_PREFIX}/plugins/rbenv-gem-rehash
# rbenv install -l for list
# install Ruby 2.1.2:
rbenv install 2.1.2
rbenv global 2.1.2
# Rehash:
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 git://github.com/sstephenson/rbenv.git ~/.rbenv
# Add rbenv to the path:
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> .bash_profile
echo 'eval "$(rbenv init -)"' >> .bash_profile
source ~/.bash_profile
# Install ruby-build:
pushd /tmp
git clone git://github.com/sstephenson/ruby-build.git
cd ruby-build
./install.sh
popd
# Install Ruby 1.9.2-p290:
rbenv install 1.9.2-p290
rbenv global 1.9.2-p290
# Rehash:
rbenv rehash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment