Skip to content

Instantly share code, notes, and snippets.

@antage
Created December 1, 2011 14:56
Show Gist options
  • Save antage/1417345 to your computer and use it in GitHub Desktop.
Save antage/1417345 to your computer and use it in GitHub Desktop.
System wide install rbenv on Debian
#!/bin/bash
# per-user install
echo 'if [ -z "$(type rbenv 2> /dev/null | head -1 | grep function)" ]; then' >> ~/.bashrc
echo ' export RBENV_ROOT=/usr/local/rbenv' >> ~/.bashrc
echo ' export PATH=$RBENV_ROOT/bin:$PATH' >> ~/.bashrc
echo ' eval "$(rbenv init -)"' >> ~/.bashrc
echo 'fi' >> ~/.bashrc
#!/bin/bash
apt-get -y install build-essential git-core zlib1g-dev libssl-dev libreadline6-dev
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# system wide install
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
ln -s /usr/local/rbenv/completions/rbenv.bash /etc/bash_completion.d/rbenv
source /etc/profile.d/rbenv.sh
git clone git://github.com/sstephenson/ruby-build.git /tmp/ruby-build
cd /tmp/ruby-build
PREFIX=/usr/local/rbenv ./install.sh
cd ..
rm -rf /tmp/ruby-build
@coder4web
Copy link

Thanks a lot :)

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