Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pparidans/3121538 to your computer and use it in GitHub Desktop.
Save pparidans/3121538 to your computer and use it in GitHub Desktop.
rbenv install Ruby 2.0.0-p0 on Debian Wheezy
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential git-core libssl-dev
# Install rbenv
RBENV_ROOT=/opt/rbenv
git clone https://github.com/sstephenson/rbenv.git $RBENV_ROOT
# Add rbenv to the path:
echo '# rbenv setup' > /etc/profile.d/rbenv.sh
echo 'export RBENV_ROOT='$RBENV_ROOT >> /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
# Plugins:
RBENV_PLUGINS_ROOT=$RBENV_ROOT/plugins
mkdir -p $RBENV_PLUGINS_ROOT
# Install ruby-build:
git clone https://github.com/sstephenson/ruby-build.git $RBENV_PLUGINS_ROOT/ruby-build
# Install vars:
git clone https://github.com/sstephenson/rbenv-vars.git $RBENV_PLUGINS_ROOT/rbenv-vars
# Install gem-rehash:
git clone https://github.com/sstephenson/rbenv-gem-rehash.git $RBENV_PLUGINS_ROOT/rbenv-gem-rehash
# Install default-gems:
git clone https://github.com/sstephenson/rbenv-default-gems.git $RBENV_PLUGINS_ROOT/rbenv-default-gems
# Default gems
cat << EOF > $RBENV_ROOT/default-gems
bundler
EOF
# Production installing gems skipping ri and rdoc
cat << EOF > /root/.gemrc
install: --no-ri --no-rdoc
update: --no-ri --no-rdoc
EOF
# Restart shell or exit re-login
#exec $SHELL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment