Created
March 2, 2012 21:42
-
-
Save shigeya/1961598 to your computer and use it in GitHub Desktop.
Script to bootstrap Ruby/RVM environment for MacOS X
This file contains hidden or 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
| #!/bin/bash | |
| export CC="gcc-4.2" | |
| DATE_START=`date` | |
| RUBY=ruby-1.9.3-p125 | |
| RUBY_DIR=`pwd` | |
| DEFAULT_GEMSETS="aimm3 oo2" | |
| cd ${HOME} | |
| echo "" | |
| echo "==> Fetching RVM" | |
| curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer > /tmp/rvm-installer.sh | |
| echo "" | |
| echo "==> Installing RVM" | |
| bash /tmp/rvm-installer.sh stable | |
| echo "" | |
| echo "==> Copying global.gems into ${HOME}/.rvm/gemsets" | |
| cp ${RUBY_DIR}/global.gems ${HOME}/.rvm/gemsets | |
| zsh <<EOF | |
| echo "" | |
| echo "==> Building iconv and readline.." | |
| rvm pkg install iconv | |
| rvm pkg install readline | |
| echo "" | |
| echo "==> Building ${RUBY}" | |
| rvm install ${RUBY} --with-readline-dir=$rvm_path/usr --with-iconv-dir=$rvm_path/usr --with-tcl-lib=/usr --with-tk-lib=/usr | |
| echo "" | |
| echo "==> create alias to make $RUBY default ruby" | |
| rvm alias create default ${RUBY} | |
| echo "" | |
| echo "==> Final setups: create gemset ${DEFAULT_GEMSETS}" | |
| for i in ${DEFAULT_GEMSETS} | |
| do | |
| rvm gemset create \$i | |
| done | |
| EOF | |
| DATE_END=`date` | |
| echo 'START: ' ${DATE_START} | |
| echo 'END: ' ${DATE_END} | |
| exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment