Skip to content

Instantly share code, notes, and snippets.

@amercier
Last active January 3, 2016 12:09
Show Gist options
  • Save amercier/8461147 to your computer and use it in GitHub Desktop.
Save amercier/8461147 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
if [ "`whoami`" != "root" ]; then
echo "You must execute this script as root" >&2
exit 1
fi
VERSION=2.1.1
URL=ftp://ftp.ruby-lang.org/pub/ruby/2.1/ruby-$VERSION.tar.gz
echo ".-------------------."
echo "| Ruby installation |"
echo "'-------------------'"
cd \
&& curl -# $URL > ruby-$VERSION.tar.gz \
&& tar xvfz ruby-$VERSION.tar.gz \
&& cd ruby-$VERSION \
&& ./configure --disable-install-rdoc \
&& make \
&& make install \
&& cd \
&& rm -Rf ruby-$VERSION ruby-$VERSION.tar.gz \
&& echo ".-----------------------------------------." \
&& echo "| Ruby $VERSION installed successfully |" \
&& echo "'-----------------------------------------'" \
&& ruby --version \
&& echo gem $(gem --version)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment