Last active
December 24, 2015 20:59
-
-
Save bradland/6861980 to your computer and use it in GitHub Desktop.
A reasonable Ruby install script. Includes "essential" deps.
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
# This build script will build Ruby 2.0.0-p247. You will need su to | |
# root or sudo as required. | |
# This build tested against Debian 7.0 64-bit arch, installed from net-inst image. | |
# These aren't specifically Ruby deps; more for building software in general | |
# (you probably already have them) | |
apt-get install -y build-essential autoconf | |
# These deps will support common libraries like yaml and give you the best irb experience. | |
apt-get install -y bison zlib1g-dev libssl-dev libreadline6-dev libncurses5-dev file libyaml-dev libxslt1-dev libxml2-dev openssl | |
# Create a directory for our source code | |
mkdir -p src && cd src | |
# Grab Ruby package and expand | |
# Debian netinst comes with wget out of the box; you can also use curl -O <url> | |
# if it's available | |
wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz | |
tar xzf ruby-2.0.0-p247.tar.gz | |
# Pause here to check the MD5 sum of the downloaded package using the following command. | |
# The checksum should equal the value supplied by https://www.ruby-lang.org/en/downloads/ | |
# Outputs 'Checksum is a go!' if passed. If you get silence, DO NOT proceed, | |
# and figure out why your download was compromised. | |
# test $(md5sum ruby-2.0.0-p247.tar.gz | cut -d' ' -f1) = c351450a0bed670e0f5ca07da3458a5b && echo 'Checksum is a go!' | |
cd ruby-2.0.0-p247 | |
# Build Ruby! | |
# Configure flags explanation: | |
# prefix=/usr/local is probably default, but I specify to be sure | |
# enabled-shared option builds libruby.so, which you may need later | |
# docdir puts docs in a Debian standard location (you may want something different) | |
./configure --prefix=/usr/local --docdir=/usr/share/doc/ruby-2.0.0 --enable-shared && make | |
make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment