Skip to content

Instantly share code, notes, and snippets.

@kou1okada
Created December 4, 2013 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save kou1okada/7789850 to your computer and use it in GitHub Desktop.
Save kou1okada/7789850 to your computer and use it in GitHub Desktop.
Install ruby-2.0.0-p353 to rbenv on cygwin64.
#!/usr/bin/env bash
TARGET_URL=http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p353.tar.gz
PATCH_URL=https://gist.github.com/kou1okada/7209539/raw/68c845108504285a44a99d01aa0db60f88d81dda/ruby-2.0.0-p247.cygwin64.patch
HASH="$(cat <<EOD
78282433fb697dd3613613ff55d734c1 *ruby-2.0.0-p353.tar.gz
067532b28c5a42b93aa6dc5ba42c630c *ruby-2.0.0-p247.cygwin64.patch
EOD
)"
TARGET_ARCHIVE="${TARGET_URL##*/}"
TARGET_DIR="${TARGET_ARCHIVE%.tar.*}"
TARGET_VERSION="${TARGET_DIR#ruby-}"
PATCH="${PATCH_URL##*/}"
cd /tmp
wget -Nc "${TARGET_URL}"
wget -Nc "${PATCH_URL}"
echo "$HASH" | md5sum -c || exit
tar xvf "${TARGET_ARCHIVE}"
cd "${TARGET_DIR}"
if [ "${PATCH}" != "" ]; then patch -p1 < "../${PATCH}"; fi
./configure --prefix="$HOME/.rbenv/versions/${TARGET_VERSION}"
make install
rbenv rehash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment