Created
February 15, 2014 12:11
-
-
Save AlecTaylor/9018523 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env bash | |
RUBY_VERSION=2.1.0 | |
printf "Installing Ruby $RUBY_VERSION\\n" | |
if [ -d ruby_build ]; then | |
rm -Rf ruby_build | |
fi | |
if [[ ! (`command -v ruby` && `ruby --version | colrm 13` == "ruby" "$RUBY_VERSION""p0") ]] ; then | |
sudo apt-get build-dep -y ruby1.9.1 | |
mkdir ruby_build && cd ruby_build | |
curl -O "http://ftp.ruby-lang.org/pub/ruby/2.1/ruby-$RUBY_VERSION.tar.gz" | |
tar xf "ruby-$RUBY_VERSION.tar.gz" | |
cd "ruby-$RUBY_VERSION" | |
./configure | |
make | |
sudo checkinstall -y --pkgversion "$RUBY_VERSION" --provides "ruby-interpreter" --replaces="ruby-1.9.2" | |
rm -Rf ruby_build | |
else | |
echo "You already have this version of Ruby: $RUBY_VERSION" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment