Skip to content

Instantly share code, notes, and snippets.

@lancelakey
Created October 4, 2012 08:55
Show Gist options
  • Save lancelakey/3832337 to your computer and use it in GitHub Desktop.
Save lancelakey/3832337 to your computer and use it in GitHub Desktop.
Debian install rbenv, ruby-build, ruby
#!/usr/bin/env bash
# Target OS: Debian
# Install rbenv, ruby-build, ruby
# Update, upgrade and install development tools:
apt-get -qy update
apt-get -qy upgrade
apt-get -qy install build-essential git-core curl libssl-dev \
libreadline5 libreadline5-dev \
zlib1g zlib1g-dev \
libmysqlclient-dev \
libcurl4-openssl-dev \
libxslt-dev libxml2-dev
# Install rbenv
git clone git://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 git://github.com/sstephenson/ruby-build.git
cd ruby-build
./install.sh
popd
rbenv install 1.9.3-p194
rbenv global 1.9.3-p194
rbenv rehash
# Disable RubyGems installing with ri and rdoc
cat << EOF > ~/.gemrc
---
install: --no-rdoc --no-ri
update: --no-rdoc --no-ri
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