Skip to content

Instantly share code, notes, and snippets.

@yarinb
Created October 11, 2011 12:51
Show Gist options
  • Save yarinb/1277995 to your computer and use it in GitHub Desktop.
Save yarinb/1277995 to your computer and use it in GitHub Desktop.
rbenv install and system wide install on Ubuntu 10.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
# Extras for RubyGems and Rails:
apt-get -y install zlib1g-dev
apt-get -y install libssl-dev libsqlite3-dev
apt-get -y install libreadline5-dev
# Install rbenv:
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Install rbenv plugins:
git clone git://github.com/sstephenson/rbenv-vars.git /usr/local/rbenv/plugins/rbenv-vars
# Add rbenv to the path:
cat << EOF > /etc/profile.d/rbenv.sh
# rbenv setup
export RBENV_ROOT=/usr/local/rbenv
export PATH="\$RBENV_ROOT/bin:\$PATH"
eval "\$(rbenv init -)"
EOF
# Reload the environment:
chmod +x /etc/profile.d/rbenv.sh
source /etc/profile.d/rbenv.sh
# Install ruby-build:
pushd $(mktemp -d /tmp/ruby-build.XXXXXXXXXX)
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
# 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
# Extras for RubyGems and Rails:
apt-get -y install zlib1g-dev
apt-get -y install libssl-dev libsqlite3-dev
apt-get -y install libreadline5-dev
# Install rbenv:
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
# Install rbenv plugins:
git clone git://github.com/sstephenson/rbenv-vars.git /usr/local/rbenv/plugins/rbenv-vars
# Add rbenv to the path:
cat << EOF >> ~/.bash_profile
# rbenv setup
export PATH="\$HOME/.rbenv/bin:\$PATH"
eval "\$(rbenv init -)"
EOF
# Reload the environment:
source ~/.bash_profile
# Install ruby-build:
pushd $(mktemp -d /tmp/ruby-build.XXXXXXXXXX)
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