Skip to content

Instantly share code, notes, and snippets.

@tamvm
Created April 21, 2014 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tamvm/11137428 to your computer and use it in GitHub Desktop.
Save tamvm/11137428 to your computer and use it in GitHub Desktop.
Install rbenv
#!/bin/bash
echo '# rbenv setup - only add RBENV PATH variables if no single user install found' > /etc/profile.d/rbenv.sh
echo 'if [[ ! -d "${HOME}/.rbenv" ]]; then' >> /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
echo 'fi' >> /etc/profile.d/rbenv.sh
chmod +x /etc/profile.d/rbenv.sh
# Install ruby-build:
pushd /tmp
rm -rf /tmp/ruby-build
git clone git://github.com/sstephenson/ruby-build.git
# Check if clone succesful
if [ $? -gt 0 ]; then
echo >&2 "Error: Git clone error! See above.";
exit 1;
fi
cd ruby-build
./install.sh
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment