Last active
August 29, 2015 14:01
-
-
Save JeffreyVdb/d7852d9f5b994df6aa34 to your computer and use it in GitHub Desktop.
Ruby install from source
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
install_ruby() { | |
# install dependencies | |
apt-get -y install zlib1g-dev libssl-dev libc6-dev libncurses5-dev | |
# due to problems on openssl on debian based distributions, install the | |
# openssl package from tvm and point to this location using the configure | |
# flags | |
# | |
# install rvm | |
apt-get -y install curl | |
curl -sSL https://get.rvm.io | /bin/bash | |
source /etc/profile | |
rvm pkg install openssl | |
# get ruby archive and install | |
wget http://ftp.ruby-lang.org/pub/ruby/ruby-${1}.tar.gz | |
tar xvzf ruby-${1}.tar.gz | |
cd ruby-${1} | |
# segmentation faults on older versions of gcc | |
# use these cflags to compile everything correctly | |
./configure | |
make | |
make install | |
cd .. | |
rm -rf ruby-${1}* | |
} | |
VERSION=$1 | |
if [ -z "$VERSION" ]; then | |
echo 'please define a version' >&2 | |
exit 1 | |
fi | |
# run install | |
install_ruby "$VERSION" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment