Created
April 21, 2014 09:26
-
-
Save tamvm/11137428 to your computer and use it in GitHub Desktop.
Install rbenv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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