Skip to content

Instantly share code, notes, and snippets.

@v1nc3ntlaw
Last active July 26, 2022 01:08
  • Star 58 You must be signed in to star a gist
  • Fork 26 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save v1nc3ntlaw/1441139 to your computer and use it in GitHub Desktop.
rbenv install ruby 1.9.3-p448 on Debian 6 Squeeze
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y 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
# Install Ruby 1.9.3-p448:
rbenv install 1.9.3-p448
rbenv global 1.9.3-p448
# Rehash:
rbenv rehash
# Production installing gems skipping ri and rdoc
cat << EOF > /root/.gemrc
---
:sources:
- http://gems.rubyforge.org
- http://gems.github.com
gem: --no-ri --no-rdoc
EOF
# Restart shell or exit re-login
#exec $SHELL
# 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.3-p448:
rbenv install 1.9.3-p448
rbenv global 1.9.3-p448
# Rehash:
rbenv rehash
@mmoya
Copy link

mmoya commented Feb 22, 2013

A translation to Ansible of the system-wide version can be found here.

@eyecatchup
Copy link

Thanks!

@adamgotterer
Copy link

I suggest changing .bash_profile to ~/.bash_profile on lines 11 and 12. If you run from any other folder it will end up creating a .bash_profile file in that dir. Otherwise this is great and thank you!

@akiradeveloper
Copy link

Thanks!!!
superb!

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